Define a function $f:\mathbb{N}\rightarrow\mathbb{N}$, \[f(1)=p+1,\] \[f(n+1)=f(1)\cdot f(2)\cdots f(n)+p,\] where $p$ is a prime number. Find all $p$ such that there exists a natural number $k$ such that $f(k)$ is a perfect square.
Problem
Source:
Tags: function, induction, algebra, polynomial, modular arithmetic, number theory proposed, number theory
20.05.2012 18:35
Solution sketch: If $p=3$, it's pretty obvious that it works. For now assume $p>3$. Then one shows via induction that for $n>1$, that if we regard $f(n)$ as a polynomial in $p$, then $f(n) = 2pQ_n(p)+1$, where $Q_n(p)$ is a polynomial in $p$ where $Q_n(p) \equiv 1 \mod 2$. Then it follows that $f(n)$ for $n>1$ cannot be a perfect square, as an odd square must be equivalent to $1 \mod 4, 8$. This can be seen by noting that $f(n+1) = [f(n)]^2-p\cdot f(n)+p$, then inducting and expanding. So it remains to check for $p=2$. But since $f(n+1) = [f(n)]^2-2f(n)+2 = \left(f(n)-1\right)^2+1$, it can't be a perfect square unless $f(n)=1$, but this cannot be, as $f(1)=3$ and $f(n)$ is clearly increasing. Therefore, the only such prime is $p=3$.
21.05.2012 15:33
The official solution is similar to yours, but alternative solution is a bit easier. Just breaking into cases where $p=2$, $p=4k+1$ and $p=4k+3$. For the first case, it is easy to see that $f(n)\equiv 2 \pmod{3}$, and for the second and third case $f(n)\equiv 3 \pmod{4}$ for all $n\ge 2$(And both are nonresidues). Thus we are left with $f(1)=x^2=p+1\implies p=3$ which is the only solution.$\blacksquare$
16.06.2012 03:00
First let $k>1$ so $p+1$ divides $x^2-p$ so $p+1$ divides $x^2+1$ so $p$ is of form $4k+1$ or $2$ (it's easy to see $p$ can't be $2$ at all) now by induction $f(n+1)=2.3^n +1$ (mod 4)=$3(mod4)$ (which is absured) so $k=1$ and $p=3$
07.07.2020 02:08
We check function mod $4$ as following: Primes are only this form mod $4$: $p$ $\equiv$ $1$$,$ $3$ $mod$ $4$, or $p$ $=$ $2$. If $p$ $\equiv$ $1$ mod $4$, we have that $f(1)$ $\equiv$ $2$, $f(2)$ $\equiv$ $3$ and then $f(i)$ $\equiv$ $2\cdot3^t+1$ and since for any $t$ $\geq$ $1$ this is congruent to $3$, therefore there are no squares in this case. If $p$ $\equiv$ $3$ mod $4$, we have that $f(1)$ $\equiv$ $0$ mod $4$ and for any $k$ $\geq$ $2$ we have that it is multiple of $f(1)$ therefore $f(k)$ $\equiv$ $3$ mod $4$ which is not a square for $k$ larger than $1$ so we only check $f(1)$: After checking $f(1)$ we see the only solution is for $p$ $=$ $3$ for which $f(1)$ $=$ $2^2$, so this concludes this case. And if $p$ $=$ $2$ we check modulo $3$, noting that $f(1)$ $=$ $3$ $\equiv$ $0$ mod $3$, so every other value is congruent to $2$ since $f(1)$ is a multiple of 3, but this cannot be a perfect square since squares mod $3$ are only congruent to $0,1$