0

While playing with numbers, I found the following properties of positive integers and prime numbers.

Properties

Every positive integer $n$ can be written in the following form \begin{align*} n = \frac{a^2 + b^2}{a + b} \end{align*} with at least 3 integer solutions. Mostly, the number of solutions is (along with probabilities of occurrence): $$\begin{matrix} 11 & 46\,\% \\ 3 & 39.4\,\% \\ 35 & 9.48\,\% \\ 19 & 3.2\,\% & \text{factorization contains square}\\ 59 & 1\,\% & \text{factorization contains $5^2$}\\ 27 & 0.6\,\% & \text{factorization contains cube}\\ 107 & 0.2\,\% \\ 83 & 0.08\,\% \\ \end{matrix}$$

Moreover, every prime number $p$ can be written in the following form \begin{align*} p = \frac{a^2 + b^2}{a + b} \end{align*} with either 3 or 11 integer solutions. The number of solutions is (along with probabilities of occurrence): $$\begin{matrix} 3 & 50.953682\,\% \\ 11 & 49.046322\,\% \\ \end{matrix}$$

Example

For \begin{align*} \frac{a^2 + b^2}{a + b} = 127 \end{align*} there is exactly 3 integer solutions: $(a = 0, b = 127)$, $(a = 127, b = 0)$, and $(a = 127, b = 127)$.

Question

Can you confirm this result? Is this known? Any feedback is welcome.

Bill Dubuque
  • 282,220
DaBler
  • 1,111
  • There will always be at least 3 solutions: with either 0 we have $(0^2+b^2)/(0+b)= b^2/b= b$, $(a^2+0^2)/(a+0)=a^2/a=a$ and with them equal $(a^2+a^2)/(a+a)=2a^2/(2a)=a$. – mathematics2x2life Nov 02 '24 at 16:33
  • 2
    @mathematics2x2life There is example with exactly 11 solutions: https://www.wolframalpha.com/input?i=%28a%5E2+%2B+b%5E2%29%2F%28a+%2B+b%29+%3D+17 – DaBler Nov 02 '24 at 16:35
  • What I meant to say was that it is obvious there is always at least 2 solutions. As for there possibly being more, it is not even clear what your question is. Is it does it happen? Even you observed that. Is it about asymptotics for this phenomena? Is it what number of solutions is it possible? Which numbers have "many solutions"? You need to make your idea here precise before anyone can say anything. – mathematics2x2life Nov 02 '24 at 16:40

1 Answers1

2

Yes, this is known. For example, let $p$ be a prime satisfying $p\equiv 3\bmod 4$. Then $$ p=\frac{a^2+b^2}{a+b}, $$ means $p(a+b)=a^2+b^2$, so that $p\mid a^2+b^2$. This implies $p\mid a$ and $p\mid b$, see here.

It is easy to see that then $p=a=b$ or either $a$ or $b$ is zero. So we have exactly $3$ integer solutions.

What happens for $p\equiv 1\bmod 4$? Then $p^2\equiv 1\bmod 4$, so that it is, uniquely the nontrivial sum of two squares, up to order and signs. So we have $x^2+y^2=p^2$ with $0<x,y<p^2$, or we have $p^2=0^2+p^2$. But $$ p=\frac{a^2+b^2}{a+b}=a+b-\frac{2ab}{a+b} $$ implies $$ p^2=(a-b)^2+\left( \frac{2ab}{a+b}\right)^2 $$ Comparing with the unique $p^2=x^2+y^2$, we obtain four times two further solutions to the cases $a=b=p$ and $a=0,b=p$, $a=p, b=0$, so $8+3=11$ solutions.

For the probabilities of a prime $p>2$ to be congruent to $1$ or $3$ modulo $4$, see for example this post:

Are primes (ignoring $2$) equally likely to be $1~\text{or}~3\pmod 4$?

Dietrich Burde
  • 140,055
  • Is the effect of the number of solutions on the factorization also known? – DaBler Nov 02 '24 at 17:21
  • I think it should follow from the prime cases, yes. If we have $n(a+b)=a^2+b^2$, and $p\mid n$, then we have $p\mid a^2+b^2$ again. – Dietrich Burde Nov 02 '24 at 17:27
  • 2
    @DietrichBurde Why 11 solutions? Given a prime $4k+1$ can you figure out what these extra 8 solutions are (or 4 if order does not matter)? – nyz Nov 02 '24 at 17:54
  • Additionally, taking prime $137=34\times 4+1$ for example, there is (-28, 60) (-28, 77) (165, 60) (165, 77), disregarding order. I can see that $-28+165=137$ and $60+77$ but not much else. – nyz Nov 02 '24 at 18:00
  • @nyz I have edited my post. So $137^2=88^2+105^2$ is the only nontrivial solution to $p^2=x^2+y^2$ for $p=137$. The trivial one is $137^2=137^2+0^2$. – Dietrich Burde Nov 02 '24 at 21:06