2

How to find the closest number to 100,000 and less than 100,000 which is a sum of two squares?

Maybe it is possible to find how many sum of square numbers are between 10,000 and 100,000? Are there few?

I know that $(a^2 + b^2)(c^2 + d^2) = (ac + bd)^2 + (ad - bc)^2$ . Or there is some criteria for knowing which number is a sum of squares in How to determine whether a number can be written as a sum of two squares? But, this could be used, I think, when I already have a number to test (or few numbers to test). I would like to avoid spending hours using trial an error on every number less than 100,000 please.

janmarqz
  • 10,538
Trux
  • 1,489
  • Do you mean how many numbers are the sum of two squares? Every number is a sum of four squares. – gammatester Jun 03 '18 at 22:21
  • yes, I meant maybe the problem gets solved, by first finding out how many numbers that are the sum of two squares are between 10,000 and 100,000 – Trux Jun 03 '18 at 23:02
  • 2
    Well you can always to $\lfloor \sqrt{100,000}\rfloor=316$ and $100,000 - 316^2 = 144$ and $\lfloor \sqrt{144-1}\rfloor = 11$ so $316^2 + 11^2 = 99977$ is pretty darned close – fleablood Jun 03 '18 at 23:09

1 Answers1

1

We have $$99997=19^2\cdot 277.$$ Here the prime $277\equiv1\pmod4$.


$271\mid99999$, $49999$ is a prime.

Jyrki Lahtonen
  • 133,153