Problem

Source:

Tags: function, induction, algebra, polynomial, modular arithmetic, number theory proposed, number theory



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.