Abstract Algebra: Theory and Applications · Problem 6.7.2

Introduction to Cryptography — Thomas Judson

Mathematics — Abstract Algebra · fermats-little-theorem-computational

Problem

Verify the truth of Fermat's Little Theorem (either variant) using the composite number 391=17⋅23391 = 17 \cdot 23 as the choice of the base (either aa or bb), and for pp assuming the value of every prime number between 100 and 1000. Build up a solution slowly --- make a list of powers (start with just a few primes), then make a list of powers reduced by modular arithmetic, then a list of comparisons with the predicted value, then a check on all these logical values resulting from the comparisons. Eventually you will write a single line that performs the verification by eventually printing out True.

Related theory

Browse the problem library