Once, a fleet of pirates were captured by an opposing fleet, who intended to kill them all. However, since they were in a good mood that day, they decided to let one of the pirates go. The way they did it was as follows:
Being the only mathematically adept pirate on the ship, Grigori was able to calculate which seat he needed to sit in (call this seat ), and thus managed to escape. He then decided to pursue a quiet life doing mathematics.
A long time later, as he was thinking about this day, he thought of an interesting problem: Let (where is an integer greater than one) be equal to the seat where one would have to sit to save oneself if there were chairs arranged in the above fashion, and let be a positive integer, also greater than one.
Find all such that is a perfect square, and input your answer as multiplied by the sum of all possible
If you think the answer is infinity, give as your answer.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We will try to generate recurrence relation between functions with distinct inputs. For odd x , after we get rid of even numbers and the first number, we are left with:
3 , 5 , 7 , 1 , 2 , 3 , ⟹ f ( x ) ⋯ , x − 2 , x . } f ( x ) ↓ ⏐ ⏐ ⏐ k : = 2 k − 1 ⋯ , 2 x − 3 , 2 x − 1 . } f ( 2 x − 1 ) = 2 f ( 2 x − 1 ) + 1
Similarly, for even x we have:
1 , 3 , ⋯ 1 , 2 , 3 , ⟹ f ( x ) , x − 3 , x − 1 . } f ( x ) ↓ ⏐ ⏐ ⏐ k : = 2 k + 1 ⋯ , 2 x − 2 , 2 x . } f ( 2 x ) = 2 f ( 2 x ) − 1 .
Since 2 0 1 8 = 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ 3 + 1 ) + 1 ) + 1 ) + 1 ) ) ) ) + 1 ) ,
then f ( 2 0 1 8 ) = 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ ( 2 ⋅ 3 + 1 ) + 1 ) + 1 ) + 1 ) − 1 ) − 1 ) − 1 ) + 1 ) − 1 = 1 9 8 9 .