Let $a_1,a_2,...,a_n$ be positive integers. Suppose that $f:\Bbb Z\to \Bbb R$ is given by $$f(x)=\begin{cases}1&x<0,\\ 1-f(x-a_1)f(x-a_2)...f(x-a_n)&x\ge 0.\end{cases}$$ Show that there exist positive integers $s,t$ st for all integers $x>s$, $f(x+t)=f(x)$.
Source : https://imomath.com/othercomp/Czs/CzsMO01.pdf
My attempt :
By induction, we can see that $f(x)=0$ or $1$ for all $x$. Therefore, $f(x)^2=f(x)$. Hence we can assume that $a_1<a_2<...<a_n$.
If $n=1$, then $f(x+2a_1)=1-f(x+a_1)=1-(1-f(x))=f(x)$ for every $x\ge -a_1$. So we can take $s=1$ and $t=2a_1$ in this case.
If $n=2$, I think we can take $t=a_1+a_2$. Not sure yet...
Edit to add : Is it possible to find an exact formula for the minimum period $t$ in terms of $a_1<a_2<...<a_n$?
Hint: Any consecutive sequence of $\max(a_i)$ values on positive integers will uniquely determine the subsequent sequence.
Hint: Show that there is some sequence of $\max(a_i)$ integers that repeats by Pigeonhole Principle on $2^{\max(a_i)} + \max(a_i)$ terms
Hence, the sequence is eventually periodic.