The algorithm for calculating the value of the function F(n)
, where n
– natural number, given by the following relations:
F(n) = 0
if n <=
0;
F(n) = F(n - 2)
if n
> 0, the last digit of the number n
is even and the number n
is not a multiple of 4;
F(n) = F(n / 4) + F(n - 2)
if n
> 0, number n
is a multiple of 4;
F(n) = n + F(n - 1)
if n > 0 and n
odd;
How many different values of n
,
less than 100 will result in F(n)
ending in 1
?