{{searchResults.length}} {{searchResults.length === 1 ? 'result' : 'results'}} for “{{searchWords}}”No results found for “{{searchWords}}”× back to contents
A sequence of non-negative integers satisfies $a_{n+2}=|a_{n+1}-a_n|$, with $a_1=100$, $a_2<100$, and $a_{2025}=1$. How many values of $a_2$ are possible?
$\gcd(a_{n+1},a_{n+2})=\gcd(a_{n+1},|a_{n+1}-a_n|)=\gcd(a_n,a_{n+1})$ (Theorem 90), so the gcd never changes and we need $\gcd(100,a_2)=1$. While two consecutive terms are positive, the larger of them drops by at least $1$ every two steps, so a $0$ appears within $2\cdot100<2025$ steps, after which the sequence is $1,1,0,1,1,0,\ldots$
Now $a_1$ is even, so $a_2$ must be odd. The parities are $0,1,1,0,1,1,\ldots$: $a_n$ is odd exactly when $n\not\equiv1\pmod3$.
$2025\equiv0\pmod3$, so $a_{2025}$ is odd, and since the sequence has reached $1,1,0$, it equals $1$. So the parity condition is automatic here.
Every $a_2<100$ coprime to $100$ works: $\varphi(100)=\boxed{40}$ (Theorem 102) values.