The integer $(1^2+1)(2^3+1)(3^4+1)(4^5+1)$ is a square, namely $2^23^25^241^2$.



> 
> **Question.** What will be the next occurrence, or is there an occurrence of $$\prod\_{i=1}^n (i^{i+1}+1)=k^2?$$
> 
> 
> 



Diophantine equation: $\prod_{i=1}^n (i^{i+1}+1)=k^2$ beyond $(n,k) = (4,1230)$?
The following criterion will most likely cover all large $n$, but actually proving this is out of reach of current technology.


**Proposition**. Let $p$ be a [Sophie Germain prime](https://en.wikipedia.org/wiki/Safe_and_Sophie_Germain_primes) (so that $q := 2p+1$ is also prime) with $p = 11 \hbox{ mod } 12$, such that $(p-1)^p + 1$ is not divisible by $q^2$. Then $\prod\_{i=1}^n (i^{i+1}+1)$ is not a square for any $p-1 \leq n < 2p$.


**Proof.** Suppose that one of the factors $i^{i+1}+1$ is divisible by the prime $q$ for some $i \leq n$. Then $i^{i+1} = -1 \hbox{ mod } q$. Since the multiplicative group of ${\bf F}\_q$ is a cyclic group of order $q-1 = 2p$, we conclude that either $i+1$ is equal to $p$ mod $2p$, or $i = -1 \hbox{ mod } q$ and $i+1$ is odd. Since $i \leq n < 2p \leq 3p-1$, the first case only occurs at $i=p-1$; since $i \leq n < 2p = q-1$, the second case does not occur at all. Hence the only factor in $\prod\_{i=1}^n (i^{i+1}+1)$ that could be divisible by $q$ is $(p-1)^p + 1$. Modulo $q$, $p-1$ is equal to $-3/2$, hence $(p-1)^p + 1$ is equal to $-(3/2)^p + 1$ mod $q$. By quadratic reciprocity, $3/2$ is a square mod $q$ when $p = 11 \hbox{ mod } 12$, so $(p-1)^p + 1$ is divisible by $q$, but by hypothesis it is not divisible by $q^2$. Hence the product is not a perfect square. $\Box$


(A slight generalisation of) the [Hardy-Littlewood conjecture](https://en.wikipedia.org/wiki/Prime_k-tuple) implies that there are infinitely many Sophie Germain primes $p$ with $p = 11 \hbox{ mod } 12$ (indeed their density in any large interval $[x,2x]$ would conjecturally be of the order of $1/\log^2 x$). The condition $(2p+1)^2 \not | (p-1)^p + 1$ is
reminiscent of a non-[Wieferich prime condition](https://en.wikipedia.org/wiki/Wieferich_prime) and it is likely that only very few Sophie Germain primes fail this condition, but this is challenging to prove rigorously. (For instance, even with the ABC conjecture, the number of non-Wieferich primes is only known to grow logarithmically, a [result of Silverman](https://en.wikipedia.org/wiki/Wieferich_prime).) Nevertheless, this strongly suggests that the above Proposition is sufficient to rule out squares for all sufficiently large $n$.


Each prime $p$ obeying the above conditions clears out a dyadic range of $n$, for instance $p=11$ obeys the conditions and so clears out the range $10 \leq n < 22$ (for all $n$ in this range the product is divisible by precisely one factor of the prime $23$). An algorithm to search for primes obeying these conditions should then keep essentially doubling the range for which no further squares are guaranteed to exist rather rapidly and numerically establish quite a large range of $n$ devoid of any additional squares.


EDIT: Here is a justification of why $q^2 | (p-1)^p + 1$ is a Wieferich type condition. If this holds, then on squaring we have
$$ (p-1)^{2p} = 1 \hbox{ mod } q^2$$
hence on multiplying by $p-1$
$$ (p-1)^q = p-1 \hbox{ mod } q^2$$
and then multiplying by $2^q$
$$ (q-3)^q = 2^{q-1} (q-3) \hbox{ mod } q^2.$$
By the binomial theorem and Fermat's little theorem we have $(q-3)^q = -3^q \hbox{ mod } q^2$ and $2^{q-1} q = q \hbox{ mod } q^2$, hence
$$ -3^q = q - 3 \times 2^{q-1} \hbox{ mod } q^2$$
which simplifies to
$$ q^2 | 3 \times 3^{q-1} - 3 \times 2^{q-1} + q$$
which can be viewed as a variant of the Wieferich condition
$$ q^2 | 2^{q-1} - 1.$$


