Dear Ali, sorry but I can't understand why, for example, for n=6, L:6 + 3 = 9 S:9 + 3 = 12 and S:6 + 2 = 8 L:8 + 2 = 10 S:10 + 2 = 12 I get 12, while you wrote a(6) = 77. Maybe I misunderstood something? Best Regards, Luca