How can this recurrence be done?

Towers of Hanoi with an Adjacency Requirement: Suppose that the monks

moving those disk in Hanoi are further restricted to only move a disk from one pole to an adjacent

one –in addition to the standard limitations for this problem. Assume polesA and C are at two

ends of a row, and pole B is in the middle. Find a recurrence relation for ak: the minimum number

of moves needed to transfer a tower of k disks from pole A to pole C.