# Expressions are not perfect square for any prime number p

For what values of $$n \in \mathbb{N}$$ does the two expressions $$n^2 + 4n + 1 - p$$ and $$2n^2 + n + 2 - p$$ ARE NOT perfect squares for any prime number $$p$$.

some progress - Manually I found out one such instance, where $$n = 21$$ there doesn't exist any prime number $$p$$ such that those two expressions could be perfect square.

We might solve each expression individually or both simultaneously.

EDIT : so peter pointed out that - For $$n=21$$, the second expression is a perfect square , for example , for $$p=761$$

Now adding the main background of this problem -

Conjecture 1 : For every $$2n = a + b$$, where $$a, b, n \in \mathbb{N}$$ there always exists minimum one pair $$(a,b)$$ such that $$2(a+n) + ab$$ is prime.

Conjecture 2 : For every $$2n = a + b$$, where $$a, b, n \in \mathbb{N}$$ there always exists minimum one pair $$(a,b)$$ with $$gcd(a,b) = 1$$ such that $$n^2 + n + (ab + 2)$$ is prime.

At this point I manually found the Exception to both the conjectures for $$2n = 42$$ implies $$n = 21$$. Even further supported by some numerical evidences.

Now lets substitute $$b = 2n - a$$ in the above expressions, with them resulting in some prime number say $$p$$

From first expression reduced to $$a^2 -a(2n + 2) -2n + p$$ we have its discriminant $$\Delta = n^2 + 4n +1 -p$$ which should must be perfect square.

Similarly for the second expression reduced to $$a^2 -2an +p -n^2 -n -2$$ we have its discriminant $$\Delta = 2n^2 +n +2 -p$$ which should must be a perfect square.

NOTE : Above both are quadratic expressions in $$a"$$

so meanwhile translating the main problem to this very reduced format, I missed very essential constraint of Conjecture 2 , that is - $$gcd(a,b) = 1$$ and now when peter pointed out that it fails for $$p = 761$$ ,surprisingly there are other primes as well...

so lets check if our $$gcd(a,b) = 1$$ criteria is met or not, After plugging $$n = 21$$ and $$p = 761$$ in the expression $$a^2 -2an +p -n^2 -n -2$$ it boils down to solve for a quadratic equation in $$a"$$ hereby - $$a^2 -42a +297 = 0$$ having roots as $$a = 9, 33$$

Finally $$a = 9$$ and $$b = 33$$ for $$n = 21$$ in the second expression, here clearly $$gcd(a,b) = 3$$

Hence my bad I couldn't induce this constraint into the problem you faced in the very beginning.

How should we approach this now, to conclude a rigorous solution.

• For $n=21$, the second expression is a perfect square , for example , for $p=761$ Feb 1, 2021 at 14:52
• can we make a progress considering the actual missing constraint $gcd(a,b) = 1$ ?! Feb 1, 2021 at 16:10

For $$\space n=21\space$$, $$2n^2 + n + 2 - 5=900=30^2.\space$$ Also, $$p=229\rightarrow 26^2\quad p=421\rightarrow 22^2\quad p=709\rightarrow 14^2\quad p=761\rightarrow12^2 \quad 941\rightarrow 6^2\quad$$ There are also five "square" solutions to $$n^2 + 4n + 1 - p,n=21$$
The following is not proof. The following numbers work for $$\space 2\le p \le 997\space$$ but this simply indicates that the "square" solutions get rarer with altitude. For any of these, there may exist a larger $$\space p\space$$ for which either function will yield a perfect square.
$$\space n\in\{59,71,75,96,98,101,120,121,122,124,126,129,133,134,136,138,140,145,\\146,149,156,164,170,171,173,174176,179,180,181,184,185,191,194,196,197,\\198,204\cdots\} \space$$
I'm suggesting that there may be no value of $$n$$ meets your criteria.