Decimal numbers are written in base 10:
For an arbitrary base
The notation
A number is divisible by 3 if the sum of its digits is divisible by 3.
A number is divisible by 4 if the last 2 digits are divisible by 4.
A number is divisible by 5 if the last digit is divisible by 5.
A number is divisible by 8 if the last 3 digits are divisible by 8.
A number is divisible by 9 if the sum of the digits is divisible by 9.
A number is divisible by 11 if the sum of digits with alternating signs is divisible by 11.
To test a large number
Then, choose an
Set up iteration
The division algorithm (or Euclid's division lemma) states that for any pair of integers
Where
From the division algorithm, a number
Two numbers
For
Note that generally division does not work. But, if
A linear congruence is an equation of the form
The conditions for solutions are:
To find a solution
Simultaneous linear congruences are a system of multiple linear congruences. They can be solved by rewriting the congruence in
For two simultaneous linear congruences to have a solution:
For three simultaneous linear congruences to have a solution:
A quadratic residue mod
If the congruence has no solutions, then
The fundamental theorem of arithmetic states that every integer greater than 1 is either prime or a unique product of primes.
A pair of integers are coprime if they have no common factors other than 1.
Euclid's lemma states that:
An integer combination of integers
Because
If
These two results give us:
Fermat's Little Theorem states that for prime
Alternatively, Fermat's Little Theorem also states that for prime
It does not follow that if this result is true that
The order of
The modular binomial theorem states that:
Proof
Consider the binomial expansion:
Consider the binomial coefficient
This coefficient will have a factor of
Footnote on solving linear congruences
Once you have one solution
Footnote on finding highest common factor using
No proof provided, but its kinda obvious?
Footnote on
This result actually isn't trivial?
By Fermat's Little Theorem,