I wrote an algorithm solving Tower of Hanoi for k pegs and I have to come up with a formula for it. The numbers are for disks ranging from 1 to 12
for 3 pegs: 1,3,7,15,31,63,127,255,511,1023,2047,4095 -> 2^n-1
for 4 pegs: 1,3,5,9,13,21,29,45,61,93,125,189 -> ?
for 5 pegs: 1,3,5,7,11,15,19,27,35,43,59,75 -> ?
I've noticed that with 4 pegs the difference between the values doubles every 2 values. Does someone know how to calculate the formula for those values? Wolfram couldn't help me.