This question already has an answer here:

I know that $2017 = 9^2+44^2$, but how can I prove that this is the only possible way you can write 2017 as a sum of 2 squares?


marked as duplicate by Namaste, apnorton, Lord Shark the Unknown, Glorfindel, dantopa Jul 12 '17 at 21:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    $\begingroup$ if you are unfamiliar with advanced number theory topics such as Gaussian integers, then brute force checking is pretty much the only way to convince yourself. $\endgroup$ – dezdichado Jul 12 '17 at 19:59
  • $\begingroup$ observation by Euler, having more than one expression means the number is composite. Article by Brillhart, December 2009, A Note on Euler's Factoring Problem $\endgroup$ – Will Jagy Jul 12 '17 at 20:01
  • $\begingroup$ It is quite quick to check in a spreadsheet. Put the numbers from $0$ to $45$ in column A, then in column B write =sqrt(2017-A^2) and scan down for an integer. Copy down is your friend. $\endgroup$ – Ross Millikan Jul 12 '17 at 20:07
  • $\begingroup$ While obviously not a proof, you can always quickly check wolframalpha, giving it the query 'solve x^2+y^2 over the integers' $\endgroup$ – Bram28 Jul 12 '17 at 20:13

$2017$ is a prime number of the form $4k+1$, and for such a numbers it is well known that the decomposition as a sum of two squares is essentially unique.

The point is that the equality $2017=9^2+44^2$ can be translated in the ring of Gaussian integers $\mathbb{Z}[i]$ as $$2017 = (9+44i)(9-44i).$$

Since $\mathbb{Z}[i]$ is a unique factorization domain, any other factorization of $2017$ coincides with the one above up to units. But the units of Gaussian integers are $\{\pm1, \, \pm i\}$, so the representation $2017= a^2+b^2$ is unique up to order and up to sign of $a$ and $b$.

  • $\begingroup$ Wow, is that a theorem? If yes, does it have a proof? $\endgroup$ – furfur Jul 12 '17 at 19:59
  • 3
    $\begingroup$ It is Fermat theorem (first proven by Euler) en.wikipedia.org/wiki/Fermat%27s_theorem_on_sums_of_two_squares $\endgroup$ – Francesco Polizzi Jul 12 '17 at 20:00
  • $\begingroup$ Ohhh... the Fermat theorem! Thanks so much, I nearly forgot about it. $\endgroup$ – furfur Jul 12 '17 at 20:01
  • 1
    $\begingroup$ @furfur Maybe not the Fermat theorem. Perhaps just a Fermat theorem. $\endgroup$ – Ethan Bolker Jul 12 '17 at 20:07
  • $\begingroup$ And the reason $9+44i$ and $9-44i$ are irreducible in $\mathbb{Z}[i]$ is essentially because their square modulus is prime. $\endgroup$ – Daniel Schepler Jul 12 '17 at 21:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.