Олимпиадный тренинг

Задача 39751. 16-16


Задача

Темы: ЕГЭ
The algorithm for calculating the value of the function F(n), where n – non-negative number, is given by the following relations:

F(0) = 5;
F(n) = n/3 + f(n/15)
if n > 0, and the number n is a multiple of 15;
F(n) = n + 1 + f(n/2) otherwise.

Determine how many distinct values n,  belonging to the segment [1, 1000000], the value F(n) is less than 100?
The sign / - means the operation of integer division.