Fermat's Two Square Theroem
An odd prime number p can be expressed as a sum of two squares if and only if p ≡ 1 (mod 4) ie one more that a number divisible by 4.
Here are some examples:
5 = (4 X 1) + 1 = 22 + 12
13 = (4 X 3) + 1 = 32 + 22
17 = (4 X 4) +1 = 42 + 12
These p ≡ 1 (mod 4) primes are not the only prime numbers the rest are of the form p ≡ 3 (mod 4) ie three more than a number divisible by 4.
Here are some examples:
7 , 11 , 19 , 23 These p ≡ 3 (mod 4) cannot be expressed as the sum of two squares.
Proofs of the theorem are very complex as shown at this link
Here is a video that includes a visual explanation which is more easy to follow though still somewhat complex:
The Real Numbers
Real numbers are broadly split into two main groups:
Rational Numbers
Numbers that can be written as a simple fraction a / b (where b is not equal to 0). This includes natural numbers (1, 2, 3 ...) , whole numbers (0, 1, 2, 3 ... ), integers (positive/negative whole numbers), terminating decimals (e.g., (0.75), and repeating decimals (e.g., (0.333...).
Irrational Numbers
Numbers that cannot be expressed as a fraction. They feature non-terminating, non-repeating decimal expansions. Common examples include π (Pi) Euler's number e , and non-perfect square roots (like √2)
Real numbers can be thought of as all points on a number line.
Here is a link to a more complete description of Real Numbers.
Some Multiplication Rules for Real Numbers
A positive number multiplied by a positive number equals a positive number
For example: +5 X + 2 = + 10
A positive number multipleid by a negative number equals a negative number
For example: +5 X -2 = -10
A negative number multiplied by a negative number equals a positive number
For example: -5 X -2 = +10
A Personal Aside
I remember the class in year 8 when my maths teacher taught us those multiplication rules.
I thought at the time that these rules were just agreed to by mathematicians. Now I would now use the term conventions. It was only much later that I realised that there were mathematical proofs for them.
The first two are fairly obvious but the third is not as clear.
Here is a video explaining why a positive times a negative is negative and a negative times a negative is positive.
The video at this link provides four proofs for a negative X a negative = a positive.
A consequence of the third rule (a negative X a negative = a positive) is that the square root of a negative number does not exist - though as we will see later that should be the square root of a negative number does not exist in the Real Numbers.
Before learning the rules above it might seem that √-4 = -2, but we now know that -2 X -2 equals +4.
Imaginary Numbers
In the mid 16th century, Geralomo Cardono, while working on cubic equations came across solutions that contained the square root of a negative number - √-121
Rafael Bombelli decided to treat square roots of negative numbers and found that doing so produced accurate real number results.
Mathematicians came to call these types of numbers Imaginary Numbers.
Leonhard Euler, in the 18th Century used the letter i to denote the imaginary unit - √-1.
The definition of i is i2 = -1 .
Complex Numbers
Here is the video that first introduced me to the idea: https://youtu.be/EV-v-9KbJ7Y



