WOLFRAM|DEMONSTRATIONS PROJECT

Fermat's Little Theorem

​
integer a
123
prime p
600
123
≡
123
(
mod
4409
)
4409
123
≡
123
(
mod
4409
)
2463975222585406517309724946224287865268279021390746629111140182972036966729403369514752921799078260400606211002811225602806537366944963415429977268194375931498343359424553913224661359681761960501098176328516001567809743801880900851180702446111052193784698725399476560057600230362099217097397488309138882672713039860544044364843117059418216440860219430491898134222258061354221584325962424079238482331353709684232212629175788068778037594436833782887976900708547525009995909788762502138940640596075779173181245778114157409825025854037232486496059970214…<<8115>>…1176507909895500425644537626924773552836562798945597600729912910617009268370112972777723092424439062530116321694522839578080652790452513865502832540309430369609161179680746930560109331451049917691585564708418027992269750870588214600470707065643227058856922980406038258328418404197087638060251430259473193950349859701326882228278499821301947056971285938412867428821794473505007637587975170346615745438706710554733409933935815403295448775902163650936505897427585857666337416759084273827891706744064168775099829250236566676599020780631675962442261446363
If
p
is prime then
p
a
≡a(modp)
for all natural numbers
a
. The number at the bottom of the display is
p
a
.