# $p^{p+1}+(p+1)^p-1$ a perfect square

For which primes $p$ is $$p^{p+1}+(p+1)^p-1$$ a perfect square?

Context:

Once again a modified problem, this time from $p^{p+1}+(p+1)^p$ a perfect square, for which the answer is no such $p$ exist. For the modified form above, however, $p=2,3$ work, the main trouble I've had being that one can't easily find prime divisors of the above number that aren't already divisors of $p$ or $p+1$.

Edit:

I forgot to say that I have already tested this statement up to $p=19$ or as far as the calculators on a computer will go without finding any other examples apart from $2$ and $3$

• For $\text{p}_4=7$ does this not work! And also not for $\text{p}_5=11$ – Jan Mar 10 '17 at 10:48
• Note that if this were a perfect square ...then $p$ must divide it – user35508 Mar 10 '17 at 10:52
• @Jan Eerland I forgot to say that I had already noticed that, and that my hypothesis is that only 2 and 3 work. Certainly, it would be unusually dense to hypothesize that the expression be a square for all primes $p$ having only tested 2 and 3. I do hope my intelligence seems to fall above that level. – tehjh Mar 10 '17 at 11:10
• We can promptly ditch all primes congruent with $1$ modulo $6$. Such primes give a "square" congruent with $2$ modulo $3$. – Oscar Lanzi Mar 10 '17 at 11:16
• Maybe i give the argument: Assume this expression is a perfect square and let $q$ be a prime factor of $p-1$. Then this expression is congruent to $2^p \mod q$, i.e. $2^p$ is a square mod $q$. But $p$ is odd, hence this means that $2$ is a square mod $q$, i.e. $q=2$ or $q=\pm 1 \mod 8$. The first primes, that you cannot rule out with that method are $17$ and $29$ and $47$. – MooS Mar 10 '17 at 12:10

This is my experience :

$A=P^{p+1}+(p+1)^p -1$

$p^{p+1}=(p^2)^\frac{p+1}{2}=k_1 p^2$

$(p+1)^p=∑ C^p_r p^r +1= k_2 p^2 +1$

$⇒A=P^{p+1}+(p+1)^p -1=(k_1+k_2)p^2$

Also:

$P^{p+1}=(p+1-1)^{p+1}=∑ C^{p+1}_r (p+1)^r +1=t_1 (p+1)^2+1$

$(p+1)^p = (p+1)^2 (p+1)^{p-2}= t_2(p+1)^2$

$⇒A=P^{p+1}+(p+1)^p -1=(t_1+t_2)(p+1)^2$

$⇒A=P^{p+1}+(p+1)^p -1=m p^2(p+1)^2$

Where m is a composite integer; for example:

$7^8+8^7-1=23 . 109 . 56^2$

It can be seen that for Fermat primes a power of $2$ is also among the factors of m:

$(2^{2^n}+1)^{2^{2^n}+2}+(2^{2^n}+2)^{2^{2^n}+1}-1= k . (2^{2^n}+1)^2. (2^{2^n}+2)^2.2^{2^n}$

For example:

$17^{18} +18^{17}-1= k .2^4 . 17^2 . 18^2$

There may exist primes of form $(x^{2^n}-1)x^{2^n}+1$ which result in A such that a composite factor like $m$, composed of even powers of some prime factors of $x$, arises; for example:

$p=15 . 16 + 1= 241$; $241^{241}+242^{241}-1=k . 2^4 . 241^2 . 242^2$

Conclusion: We may conclude that;

a : The solutions are only $p=2$ and $p=3$ because m has square free prime factors.

b: Conjecture: There are primes other than 2 and 3 so that $A=P^{p+1}+(p+1)^p -1$ is perfect square.