Quora: IMO 1988 Question 3

Problem A3

A function f is defined on the positive integers by:

for all positive integers n,

$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)$

Determine the number of positive integers n less than or equal to 1988 for which f(n) = n.

What is the explanation of the solution of problem 3 from IMO 1988? by Alon Amit