Prime numbers yield from Pythagoras triples

Let $a=2xy,$ and $b=x^2-y^2$.

Hence, we obtain: $$\frac{(2xy)^4+(x^2-y^2)^4+(2xy+x^2-y^2)^4}{(2xy)^2+(x^2-y^2)^2+(2xy+x^2-y^2)^2}=x^4+y^4+2x^3y-2xy^3+2x^2y^2.$$ We can get this expression by the following. $$\frac{a^4+b^4+(a+b)^4}{a^2+b^2+(a+b)^2}=\frac{2(a^4+2a^3b+3a^2b^2+2ab^3+b^4)}{2(a^2+ab+b^2)}=$$ $$=\frac{(a^2+ab+b^2)^2}{a^2+ab+b^2}=a^2+ab+b^2=x^4+y^4+2x^3y-2xy^3+2x^2y^2.$$

Now, easy to find a counterexample: $x=10$ and $y=1$, which gives $a=20$ and $b=99.$


If you cancel common factors the fraction comes out to $$a^2+ab+b^2=c^2+ab=(a+b)^2-ab$$

Now if $a, b$ have a common factor this will certainly not be prime.

If $(a,b,c)$ is a primitive triple, then $abc$ is divisible by $60$ and the primes $2,3,5$ can't divide the expression, which is co-prime to $a,b,c$

Suppose we want $a^2+ab+b^2$ divisible by $p$. We have, modulo $p$ $$a\equiv \frac {-b\pm \sqrt{b^2-4b^2}}2=b\cdot\frac {-1\pm \sqrt{-3}}2$$so we need $-3$ to be a quadratic residue mod $p$ - for odd primes this means $p=6n+1$ (actually this should be obvious from $\omega^3=1$)

As Michael Rosenberg observes via a different route, with $a=x^2-y^2$ and $b=2xy$ the expression becomes $$x^4+2x^3y+2x^2y^2-2xy^3+y^4$$

You can investigate this modulo $p$ and should find that the smallest prime which can appear as a factor in the primitive case is $13$ - eg for $x=5, y=2, a=21, b=20$ giving $13\times 97$

$37$ is also possible (and indeed appears as one of the primes you found) and $61$.

If I had a little time I'd be checking why it is that primes $\equiv 13 \bmod 24$ seem to be turning up. Checking through further $109, 157, 181, 229$ all work.

Then we had $97$ from the example for $13$ and modulo $24$ this suggests $25, 49, 73, 97$, with the first two not prime and indeed $73$ does allow composite values.

So conjecture that the prime factors are all equivalent to $1\bmod 12$ (there are no solutions modulo $7$, for example). Since this excludes a lot of small primes it is not surprising that it is not so easy to find composite solutions.


To give some examples:

For $p=13$ we have

$$\begin{array}{c|c|c|c|} x & y & a & b & a^2+ab+b^2 & (a^2+ab+b^2)/p\\4& 3& 7& 24 &793 &61\\ 5 &2 &21 &20 &1261& 97\\ 5 &4 &9 &40& 2041& 157\\ 6 &5 &11 &60 &4381& 337\\ 7 &2 &45 &28& 4069& 313\\ 8 &3 &55 &48& 7969& 613\\ 9 &2 &77 &36& 9997& 769\\ 10 &1 &99 &20& 12181& 937\\ 10 &7 &51 &140& 29341& 2257\\ 12 &7 &95 &168& 53209& 4093\\ 14 &3 &187 &84 &57733 &4441\\ 15 &4 &209 &120 &83161 &6397\\ 16 &5 &231 &160 &115921 &8917\\ 17 &8 &225 &272 &185809 &14293 \end{array}$$

For $p=37$ we have

$$\begin{array}{c|c|c|c|} x & y & a & b & a^2+ab+b^2 & (a^2+ab+b^2)/p\\10&7&51&140&29341&793\\ 11&4&105&88&28009&757\\ 12&1&143&24&24457&661\\ 14&9&115&252&105709&2857\\ 16&5&231&160&115921&3133\\ 18&1&323&36&117253&3169 \end{array}$$

$p=61$ gives $$\begin{array}{c|c|c|c|} x & y & a & b & a^2+ab+b^2 & (a^2+ab+b^2)/p\\ 4&3&7&24&793&13\\ 8&5&39&80&11041&181\\ 10&7&51&140&29341&481\\ 23&2&525&92&332389&5449 \end{array}$$ For $p=73$ $$\begin{array}{c|c|c|c|} x & y & a & b & a^2+ab+b^2 & (a^2+ab+b^2)/p\\ 9&4&65&72&14089&193\\ 13&10&69&260&90301&1237\\ 14&5&171&140&72781&997\\ 19&12&217&456&353977&4849\\ \end{array}$$ For $p=97$ $$\begin{array}{c|c|c|c|} x & y & a & b & a^2+ab+b^2 & (a^2+ab+b^2)/p\\ 5&2&21&20&1261&13\\ 13&2&165&52&38509&397\\ 17&6&253&204&157237&1621\\ 37&2&1365&148&2087149&21517\\ \end{array}$$


To go back to the analysis we have, modulo $p$, $a=\omega b$ where $\omega^2+\omega+1=0$ and $\omega^3 =1$.

We want $x^2-y^2=2\omega xy$ whence $x^2-2\omega xy-y^2=0$ and $$x=y\cdot \left(\omega \pm \sqrt {\omega^2+1} \right) = y\cdot \left(\omega \pm \omega \sqrt {\omega+1} \right)=y\cdot\left(\omega \pm \omega^2\sqrt {-1} \right)$$

Hence we need $-1$ to be a square $\bmod p$ ie $p\equiv 1 \bmod 4$ and since we already have $p\equiv 1 \bmod 6$ we must have $p\equiv 1 \bmod 12$.


Observe also that the numbers in the final column can only have prime factors $\equiv 1 \bmod 12$ ie $13, 37, 61, 73, 97$ so it is very easy to test whether these are prime.


Further note with $x=10, y=7$ we have $a=51, b=140, a^2+ab+b^2= 13\times 37 \times 61= 29341$

$x=23, y=20$ gives $13^2\times 37 \times 157$

$x=49, y=4$ gives $6776809=13\times 37 \times 73 \times 193$

$x=124, y=99, 13\times 37\times 61 \times 109 \times 241$

See my other answer for data which would enable the Chinese Remainder Theorem to be used to obtain arbitrary numbers of prime factors.


$P_{prime}(6,8)=148$ is not prime

$P_{prime}(7,24)=793=13\cdot61$ so it doesn't hold even for primitive triples