This can be achieved with two customizations: a custom field and a custom workflow rule.
You can create a custom field at the Task level and call it "Grandparent."
Your workflow rule (also at the Task level) should run "Every time a record is created or edited" and under the conditions "If True = Not(IsNull($Parent.Parent))"
If this is the case, the action would be to update the aforementioned Grandparent field with "$Parent.Parent.Name"
Note, this will only work for newly created/edited tasks. You can create a similar scheduled workflow rule to go through and back-fill the pre-existing tasks, if necessary. Be sure to disable this to help keep performance increased.
I hope this helps.