This problem was part of an IMO (International Math Olympiad) problem. It requires a bit more math than some of the others I've posted, but I hope you try it as it has a neat idea behind it.
Define a function f over all positive integers as:
f(1) = 1
f(3) = 3
f(2n) = f(n)
f(4n+1) = 2f(2n+1) - f(n)
f(4n+3) = 3f(2n+1) - 2f(n)
Under which conditions does f(n) = n?
|