Question: !()*#)(!@# Let's say that an integer (n >= 2) is a fermat probable prime if the congruence a^(n-1) to 1 (mod n) holds for the

!()*#)(!@#

Let's say that an integer (n >= 2) is a fermat probable prime if the congruence a^(n-1) to 1 (mod n) holds for the first five consecutive attempts using a sequence of five random chosen integers a with 2 <= a < n. Note that if the congruence of a^(n-1) to 1 (mod n) fails to hold for even one choice of 2 <= a < n, then n is definitely composite (by fermats little theorem). Please write a python program to run this probability primaility test on the following integers, declaring each number to be either a fermat prbably prime or composite. Use randrange(2,n). Do not use powerful commands such as is_prime but you can create Mod(,) command to find inverses modulo n.

The numbers to check:

n1 = 133324441

n2 = 976303487

n3 = 6129388091

n4 = 3324344347

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!