Problem. Let $(a_n)_{n \geq 0}\subseteq \mathbb{Z}$, defined by: $a_n=(n^2+3)(n^2-13)(n^2+39), \forall n \in \mathbb{N}.$ Show that for any natural number $m \geq 2$, there exists $n\in \mathbb{N}$, such that $m|a_n$.
This problem was proposed a long time ago for an JBMO selection, but unfortunately I don't have neither the exact source nor the official solution. Therefore, I have come up with my own.
Please check these arguments (maybe with all the details, if possible), and any suggestions, improvements, or even shorter, ellegant solutions are more than welcome. Thank you for your time and effort!
Before solving, first some additional considerations about quadratic residues:
Proposition.
a) Let $p$ be a prime natural number and $a\in \mathbb{Z}, p\nmid a$. Then $a$ is quadratic residue modulo $p$ iff $a$ is quadratic residue modulo $p^k$, for any natural number $k\geq 1$.
b) Let $a$ be an odd integer, and $k\geq 3$ be a fixed natural number. Then $a$ is quadratic residue modulo $2^k$ iff $a\equiv 1$ (mod $8$).
Proof:
$a)$ As the converse is obvious, it remains to show the direct implication, by induction over $k\geq 1$. Let $n_1\in \mathbb{N}$, for which $p^1|n_1^2-a$, this is the verification step. Suppose that for a certain $k\geq 1$ we have constructed $n_k\in \mathbb{N}$, for which $p^k|n_k^2-a$, and we want to find a $n_{k+1 }\in \mathbb{N}$, for which $p^{k+1}|n_{k+1}^2-a$. For this, we will look for $\lambda \in \mathbb{N}$, with $n_{k+1}=n_{k}+\lambda p^k$. So:
$$p^{k+1}|n_{k+1}^2-a \Leftrightarrow p^{k+1}|n_k^2-a+\lambda^2p^{2k}+2\lambda n_kp^k \Leftrightarrow p|x_k+2\lambda n_k, \tag{1}$$
where $x_k:=(n_k^2-a)/p^k \in \mathbb{Z}$. If somehow $p|n_k$, from $p|p^k|n_k^2-a$ would result $p|a$, contradiction with the hypothesis! So $p\nmid n_k, p\nmid 2 \Rightarrow p\nmid 2n_k$. Thus:
$$(1) \Leftrightarrow (2n_k)\lambda \equiv -x_k (\text{mod p}) \Leftrightarrow \lambda \equiv -x_k(2n_k)^{-1} (\text{mod p}). \tag{2}$$
We choose $\lambda\in\mathbb{N}$, which verifies the condition from $(2)$, and the induction is complete.
$b)$ ($\Rightarrow$) If $a$ is quadratic residue modulo $n$, then it is quadratic residue modulo any divisor of $n$. Here, $a$ will become a quadratic residue modulo $2^3=8$. As $a$ is odd, and the quadratic residues modulo $8$ are $0,1,4$, it follows that $a\equiv 1$ (mod $8$).
($\Leftarrow$) Let $a\equiv 1$ (mod $8$), then, as above, $a$ is quadratic residue modulo $8$. We will show (similar to point $a)$ by induction after $k\geq 3$ that $a$ is quadratic residue modulo $2^k$, for any such $k$. The verification step is already done, and $n_1\in \mathbb{N}$ appears, for which $2^3|n_1^2-a$. Suppose that for a certain $k\geq 3$ we have constructed $n_k\in \mathbb{N}$, for which $2^k|n_k^2-a$, and we want to find a $n_{k+1} \in \mathbb{N}$, for which $2^{k+1}|n_{k+1}^2-a$. For this, we will look for $\lambda \in \mathbb{N}$, with $n_{k+1}=n_{k}+\lambda 2^{k-1}$ ($2^k$ is not enough, since $2$ is non-invertible modulo $p=2$). So:
$$2^{k+1}|n_{k+1}^2-a \Leftrightarrow 2^{k+1}|n_k^2-a+\lambda^2p^{2k-2}+\lambda n_k2^k \Leftrightarrow 2|x_k+\lambda n_k, \tag{3}$$
where $x_k:=(n_k^2-a)/2^k \in \mathbb{Z}$. If somehow $2|n_k$, from $2|2^k|n_k^2-a$ would result $2|a$, contradiction with the fact that $a$ is odd! So $2\nmid n_k$, and then:
$$(3) \Leftrightarrow n_k\lambda \equiv -x_k (\text{mod 2}) \Leftrightarrow \lambda \equiv -x_k (\text{mod 2}). \tag{4}$$
We choose $\lambda\in \{0,1\}$, which verifies the condition from $(4)$, and the induction is complete. $\Box$