f(1)=1, f(n)=f(n/2) for n even, f(n) = f(n-1) + (-1)^f(n-1) for n odd.
Source: Spain Mathematical Olympiad 2020 P2
July 14, 2020
recurrence relationSpain
Problem Statement
Consider the succession of integers {f(n)}n=1∞ defined as:
∙f(1)=1.
∙f(n)=f(n/2) if n is even.
∙ If n>1 odd and f(n−1) odd, then f(n)=f(n−1)−1.
∙ If n>1 odd and f(n−1) even, then f(n)=f(n−1)+1.a) Compute f(22020−1).b) Prove that {f(n)}n=1∞ is not periodical, that is, there do not exist positive integers t and n0 such that f(n+t)=f(n) for all n≥n0.