To calculate large powers modulo m
Define a = 2789596378267275, n = 3848590389047349, and m = 2838490563537459.
Evaluate
anmodm = 26220 18141 09828
Fermat's Little Theorem states that, if p is prime and 0 < a < p, then
Evaluate
21008mod1009 = 1