Hello 2017

Standard

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 $p$ can be written as sum of two squares if and only if it is can be written as $4n+1$ for some integer $n$. 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 $z$ such that $z^2+1$ is divisible by 2017.

Choose any quadratic non-residue $a$ modulo 2017 because then $a^{1008} +1$ is divisible by 2017. Since half of the residues modulo 2017 are quadratic non-residue, it’s easy to check our guess using $a^{1008} +1$ divisibility. Easy to observe that $a=5$ is smallest solution (in fact here is the list of quadratic non-residues modulo 2017 generated by WolframAlpha). Hence $z\equiv 5^{504} \pmod{2017}$, we get $z=229$.

Step 2: Compute the greatest common divisor of 2017 and $229+i$ using the Euclidean algorithm for the Gaussian integers. The answer will be $x+yi$ where $x^2+y^2=2017$.

Note that norm of any Gaussian integer $r+si$ is $r^2+s^2$. 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: $44^2 + 9^2 = 2017$.

You may find this property of 2017 not so special, since there are infinitely many primes of form $4n+1$. Please let me know more interesting properties of this number…