#!/bin/sh set -eu PROOF=${PROOF:-/app/proof.md} mkdir -p "$(dirname -- "$PROOF")" cat > "$PROOF" <<'IMO_PROOF_25823c9e705bbb7180ed55319546730cc034932e770b777af059a80fc451705d' First, let's prove the following Lemma, which is an extension of Euler's theorem. Given positive integers $n$ and $a$, there exists a positive integer $N$ such that for any positive integer $k \geq N$, $a^{k+\phi(n)} \equiv a^{k}(\bmod n)$ holds. Let $p_1, p_2, \cdots, p_t$ the common prime divisors of $n$ and $a$, and let $\max_{1\le i\le t} v_{p_i} (n) =M$. Then, if we set $N=M$, the conclusion holds. Let $n=p_n \times q_n$, $a=p_a \times q_a$, where $p_n$ and $p_a$ represents the $p_1, p_2, \cdots, p_t$ part of the prime factorization of $n, a$, respectively. Note that $p_n | (p_1 p_2 \cdots p_t )^M$, and that $(a, q_n) =1$. First, if $k \geq M$, then $a^{k+\phi(n)} \equiv a^{k} \equiv 0\left(\bmod p_n \right)$. Also, $\phi(n)=\phi\left(p_n \right) \cdot \phi(q_n)$, so \[ a^{k+\phi(n)} \equiv a^{k+\phi\left(p_n\right) \cdot \phi(q_n)} \equiv a^{k}(\bmod q_m) \] holds. Combining the two equations, we obtain $a^{k+\phi(n)} \equiv a^{k}(\bmod n)$, which completes the proof. $\qed$ Let's also prove the following Lemma about $F_{n}$. Given positive integers $n$ and $a$, there exists a positive integer $N$ such that for any positive integer $k \geq N$, $F_{k} \equiv F_{k+\Phi(n)}(\bmod n)$ holds. Here, $\Phi(n)$ is the least common multiple of $n, \phi(n), \phi^{(2)}(n), \ldots$. We will prove this by induction on $n$. (1) (Base case) If $n=1$, the statement holds trivially. (2) (Induction step) Assume that the statement holds for all positive integers less than $n$. By the induction hypothesis, there exists a positive integer $N$ such that for $k \geq N$, \[ F_{k} \equiv F_{k+\Phi(\phi(n))}(\bmod \phi(n)) \] holds. Now, consider the least common multiple of $\Phi(\phi(n))$ and $n$, which is $\Phi(n)$. Since $F_{k+1}=(k+1)^{F_{k}}$, by $, \[ (k+\Phi(n)+1)^{F_{k+\Phi(n)}} \equiv(k+1)^{F_{k+\Phi(n)}} \equiv(k+1)^{F_{k}}(\bmod n) \] holds for all sufficiently large $k$. Therefore, the statement also holds for $n$. $\qed$ Now, let's prove the original problem. $ \operatorname{gcd}(\Phi(\phi(c)), c) Factorize $c$ into primes as $c=p_{1}^{e_{1}} \cdots p_{k}^{e_{k}}$. Also, let $p_{1}<\cdots0$. Then, $\phi(c)=p_{1}^{e_{1}-1} \cdots p_{k}^{e_{k}-1}\left(p_{1}-1\right) \cdots\left(p_{k}-1\right)$, and since $p_{i}-1$ is not a multiple of $p_{k}$, \[ v_{p_{k}}(\phi(c)) Therefore, by induction, for all positive integers $r$, $v_{p_{k}}\left(\phi^{(r)}(c)\right) Applying strong induction on $c$ We will prove the problem by strong mathematical induction on $c$. If $c=1$, the statement holds for any positive integer $n$. Assume that the statement holds for $c=1, \ldots c-1$, and let's prove the statement for $c$. First, choose $n$ large enough so that \[ a^{F_{n}} \equiv a^{F_n+\phi(c)}(\bmod c) \] holds. By , $\operatorname{gcd}(c, \Phi(\phi(c))) By , among these solutions, for sufficiently large $n$, \[ a^{F_{n}} \equiv a^{F_{n+\Phi(\phi(c))}}(\bmod c) \] holds. Let this $n$ be $n_{0}$. Consider the following system of congruences for $n$: \[ n \equiv n_{0}(\bmod \Phi(\phi(c))), a^{F_{n_{0}}}+n \equiv b(\bmod c) \] This system of congruences has $n_{0}$ as a solution modulo $\operatorname{gcd}(c, \Phi(\phi(c)))$, so by the Chinese Remainder Theorem, there exists an $n$ that satisfies both congruences modulo $\operatorname{lcm}(\Phi(\phi(c)), c)$. For this $n$, \[ a^{F_{n}}+n \equiv a^{F_{n_{0}}}+n \equiv b(\bmod c) \] holds, so the desired equation holds, and therefore the induction hypothesis holds for $c$. By induction, for all $c$, there exist infinitely many $n$ that satisfy $a^{F_{n}}+n \equiv b(\bmod c)$. IMO_PROOF_25823c9e705bbb7180ed55319546730cc034932e770b777af059a80fc451705d