Fermat's 'little' Theorem, and introducing a standard term: the Fermat quotient, q[p](a) 

 

 

 

Fermat's (the discoverer, not the prover) little theorem (mid 1600's). For every prime p and integer `<>`(a, 0) (mod p) satisfies 

 

`^`(a, `+`(p, `-`(1))) = 1 (mod p) 

 

 

(I understand you will have encountered this in your second year course on Number Theory.) 

 

 

In particular, for every odd prime p we have 

 

`^`(2, `+`(p, `-`(1))) = 1 (mod p) 

 

 

A standard term. From the just seen congruence, translating into its equation equivalent, we have: 

 

 

`+`(`^`(2, `+`(p, `-`(1))), `-`(1)) = Mp 

 

for some integer M, giving: 

 

M = `/`(`*`(`+`(`^`(2, `+`(p, `-`(1))), `-`(1))), `*`(p)) 

 

 

That integer M, is known as the Fermat quotient to the base 2, q[p](2): 

 

 

> L := []: for p from 3 to 50 do if isprime(p) then

            q||p := (2^(p-1) - 1)/p:

                L := [op(L), p]: fi od:

     print(``); print(array([['p', ``, ``, 'q[p](2)'],

          seq([p, ``, ``, q||p], p = L)])): print(``);
 

 

 

array( 1 .. 15, 1 .. 4, [( 4, 3 ) = (``), ( 9, 2 ) = (``), ( 12, 2 ) = (``), ( 7, 4 ) = (3855), ( 1, 2 ) = (``), ( 4, 1 ) = (7), ( 13, 4 ) = (26817356775), ( 11, 3 ) = (``), ( 6, 4 ) = (315), ( 12, 3 ...
(5.1.1)
 

>
 

 

 

A very quick note in passing. Primes for which are called Wieferich primes  

 

                                                (see, e.g.,  https://en.wikipedia.org/wiki/Wieferich_prime) 

 

They have a connection with the famous 'Fermat's last Theorem' ... .  

 

Only two are known, 1093 and 3511 (the current search limit is `+`(`*`(6.7, `*`(`^`(10, 15)))) ): 

 

 

> print(``); p := 1093; print(``);(2^(p-1) - 1)/p; print(``);  (2^(p-1) - 1)/p mod p;
 

 

 

 

 

 

1093
48543949031099391342540292927981572313997235494758711321639112167193686125995034049081484743851357331808162250378285765507200385776085494235888710625859977991643425132256369838542372427395502382944151...
48543949031099391342540292927981572313997235494758711321639112167193686125995034049081484743851357331808162250378285765507200385776085494235888710625859977991643425132256369838542372427395502382944151...
48543949031099391342540292927981572313997235494758711321639112167193686125995034049081484743851357331808162250378285765507200385776085494235888710625859977991643425132256369838542372427395502382944151...
48543949031099391342540292927981572313997235494758711321639112167193686125995034049081484743851357331808162250378285765507200385776085494235888710625859977991643425132256369838542372427395502382944151...
48543949031099391342540292927981572313997235494758711321639112167193686125995034049081484743851357331808162250378285765507200385776085494235888710625859977991643425132256369838542372427395502382944151...
0 (5.1.2)
 

>
 

> print(``); p := 3511; print(``);(2^(p-1) - 1)/p; print(``);  (2^(p-1) - 1)/p mod p;
 

 

 

 

 

 

3511
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
11745025150683815680713113703694061390171794525491609975684377314508090074353996823373411643929459484313158387823671563903950230018753749189709735447914335049001265054585325953721540858186371043095188...
0 (5.1.3)
 

>