The Jester is visiting his grandmother who lives over the hills and through the woods. Why? Because it's her birthday! On his way, he knows he will meet 7 trolls. Each troll, quite rightly, insists that he pays a troll toll. Before he can pass, he has to give them half of the cakes he is carrying, but as they are kind trolls, they each give him back a single cake.
This text was taken from Royal Road. Help the author by reading the original version there.
How many cakes does the Jester have to leave home with to make sure that he will arrive at Grandmother's house with exactly 2 cakes?