0

It's well known that a prime of the form $4n+1$ is the sum of $2$ squares. But I stumbled across this slight variation and I have absolutely no idea how to prove it; I'm not even sure if this is true.

Bill Dubuque
  • 282,220
  • Don't forget that x, y are distinct – Deathwing Oct 07 '24 at 17:23
  • 1
    Seems to be true for the first $10,000$ primes of the given form and for some other numbers. For instance $10 = \frac{4^2 + 12^2}{4+12}$. In fact, it seems that 70-75% of integers have a representation in the given form with distinct $x$ and $y$. (I only call out the last feature because of a mental error in my now deleted comment(s).) – Eric Towers Oct 07 '24 at 17:38
  • if I call the number $n,$ the correct restriction is that $n$ be divisible by at least one prime $r \equiv 1 \pmod 4$ – Will Jagy Oct 07 '24 at 18:16
  • 1
    Its truly a shame that more effort wasn't put in by the OP in writing this question up to meet the MSE Guidelines [tour]. It is interesting indeed... – Mike Oct 07 '24 at 20:29

2 Answers2

5

If $p=X^2+Y^2$, then $p=\dfrac{((X+Y)X)^2+((X+Y)Y)^2}{(X+Y)X+(X+Y)Y}$,

so take $x=(X+Y)X$ and $y=(X+Y)Y$.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
3

Later, to show how I got here: the integer equation $x^2 + y^2 - nx - ny=0,$ upon completing both squares, becomes $$ \color{red} {(2x-n)^2 + ( 2y - n)^2 = 2 n^2 } $$

The method below can be done for every number $n$ divisible by at least one prime $r \equiv 1 \pmod 4.$ Furthermore, in the long run, the density of numbers that are not divisible by any prime $r \equiv 1 \pmod 4$ is zero, see displayed formula, from sum of prime reciprocals Does the sum of reciprocals of primes congruent to $1 \mod{4}$ diverge?

$$\sum_{\substack{p \equiv a \bmod b \\ p \leq X}} \frac{1}{p} \; \; \; \; = \; \; \frac{1}{\varphi(b)} \; \log \log X + O(1) $$ That is, the set of numbers which have at least one prime factor $r \equiv 1 \pmod 4$ has full density.

Given such an $n$ we can arrange $$ n^2 = u^2 + v^2 $$ with integers $u > v > 0.$

Then simply take $$ \color{magenta} { x = \frac{n+u+v}{2}, } $$ $$ \color{teal} { y = \frac{n+u-v}{2} } $$

to achieve $$ \frac{x^2 + y^2}{x+y} = n$$

With my calculations, I got $$ 2(x^2 + y^2) = n^2 + 2un + u^2 + v^2 = n^2 + 2un + n^2 = 2 n^2 + 2un $$

and $$ 2 (x+y) = 2n+2u $$ so that $ \frac{x^2 + y^2}{x+y} = n$

Various notes: any integer $k$ we have $k^2 \equiv k \pmod 2.$

Will Jagy
  • 146,052