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

Задача 39773. 16-21


Задача

Темы: ЕГЭ
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 different values ​​the G(n) function takes on the segment [100, 100000]?
The sign / - means the operation of integer division.