Codeforces Round #729 Strange Function Solution (Java/C++)
Solution: First, we can note that: when i is odd number, f(i)=2.Then we consider the case that f(i)=3. Based on the definition, if and only if i is even number and i cannot be divisible by 3, then f(i)=3.…