# all prime numbers except 2 can write in the form $4n\pm1$

First I saw this, I was excited When I checked prime numbers and saw they are in this form. after checking more numbers I understood that every odd numbers can be written in this form then I showed it:

$$4n\pm1=2(2n)\pm1\rightarrow 2k\pm1$$ ( $$k$$ is even)

Here are my questions:

Question$$1$$: Why We should represent prime numbers in this form when it is equivalent to saying every prime numbers except $$2$$ are odd?

Question$$2$$: here we represented odd numbers with $$4n\pm1$$. It is maybe the first time I see kind of exchange in representation in mathematician. Please explain when we use such exchanges in numbers representation and is there resource to study about it or any generalization of this?

• Note that all primes except $2$ are odd (i.e. not divisible by two), and that every odd number is of the form $4n\pm 1$. You might be interested in the fact that primes other than $2,3$ are of the form $6n\pm 1$. Jul 22, 2020 at 21:24

Hint: Every integer can be written as $$4n+r$$, with $$r \in \{0,1,2,3\}$$. This is Euclidean division by $$4$$ with remainder. Note that $$4n+3 = 4(n+1)-1$$. When $$r \in \{0,2\}$$, the number $$4n+r$$ is even.

• Nice, I am not expert in math. How often we use such representation in mathematics? for example do we ever need show Multiple‎s of number $k$ in form "$an\pm b$"? Jul 22, 2020 at 21:38
• " for example do we ever need show Multiple‎s of number k in form "an±b"?" ALL the time. It's called modulo arithmetic and is basic to all results in number theory. We classify numbers but their "divisibility" by $n$, that is to say by what remainder they have when divided by $n$. It is a fundamental way of characterizing and leads to many results about characteristic of integers and divisibility. Jul 22, 2020 at 21:58

Well, if $$p=4k$$, then $$4|p$$ and so $$p$$ is not prime.

If $$p=4k+2=2(2k+1)$$ then $$2|p$$ and so $$p$$ is not prime unless $$p=2$$.

The only cases left are $$p=4k\pm 1$$, and neither have a general factor.

For your 1st question, the reason mathematicians differentiate between primes of the form 4n+1 and 4n-1 is because a lot of results only hold for 4n+1 primes and a lot of results only hold for 4n-1 primes, particularly in modular arithmetic, such as the number of solutions to x^2 + y^2 = 1 in prime fields. Hope this helps!

Somewhat related and a little bit more interesting: Every prime except 2 and 3 is of the form: $$6k \pm 1$$. Fun exercise.