2017 is a prime number!! In fact this is 306th prime year A. D. The previous prime year was 2011 and next one will be 2027.
Moreover, 2017 leaves a remainder of 1 when divided by 4. So, this can be represented as sum of two squares. How do we know?
Fermat’s two-square theorem: An odd prime can be written as sum of two squares if and only if it is can be written as for some integer . Moreover, this representation is unique.
Unlike the three-square theorem discussed in previous post, this is not that difficult to prove (the only challenging part is to show that if the prime leaves a remainder 1 when divided by 4 then it “can” be written as sum of two squares). There are many ways to prove this, and there is a Wikipedia page dedicated to the popular proofs of it. But my favorite proof is the one by Richard Dedekind, it requires knowledge of Gaussian integers and some College algebra (properties of unique factorization domain). You can find “existence” proof here and “uniqueness” proof here.
I will end this post with writing step-by-step procedure of writing 2017 as sum of two squares by following the algorithm explained here:
Step 1: Find such that is divisible by 2017.
Choose any quadratic non-residue modulo 2017 because then is divisible by 2017. Since half of the residues modulo 2017 are quadratic non-residue, it’s easy to check our guess using divisibility. Easy to observe that is smallest solution (in fact here is the list of quadratic non-residues modulo 2017 generated by WolframAlpha). Hence , we get .
Step 2: Compute the greatest common divisor of 2017 and using the Euclidean algorithm for the Gaussian integers. The answer will be where .
Note that norm of any Gaussian integer is . Hence, the norm of 229+i, N(229+i) = 52442. For euclidean algorithm I will use long division/calculator as:
For Gaussian integers we first multiply the denominator by its conjugate and then use calculator to compute real and imaginary parts of the quotient separately.
2017 = (229+i)(8) +(185-8i) ; N(185-8i) = 34289
229 + i = (185-8i)(1) + (44+9i); N(44+9i) = 2017
185-8i = (44+9i)(4-i) + 0
Hence, the gcd is 44+9i.
Finally, we get: .
You may find this property of 2017 not so special, since there are infinitely many primes of form . Please let me know more interesting properties of this number…