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

Задача 39775. 16-22


Задача

Темы: ЕГЭ
The algorithm for calculating the value of the functions F(n)  and G(n), where n – natural number, given by the following relations:

F(n) = n if n < 100;
F(n) = n + F(n/3), otherwise;
G(n) = n + 1 if n < 100;
G(n) = G(F(n/2)) otherwise.

Determine how many distinct values n,  belonging to the segment [100, 100000], the function G(n)=99?
The sign / - means integer division operation.