This lab reviews the fundamentals of project management in C including compiling, debugging, and testing programs.
The projects in this class are difficult. Practicing these fundamentals will save you valuable time and effort when facing harder tasks.
Fermat's Little Theorem (FLT) is an axiom in number theory. It states that if p is prime and x is not a multiple of p, then x^(p-1) % p = 1.
Conversely, when a number n is not prime there (usually) exists some witness w (which is not a multiple of n) where w^(n-1) % n /= 1.
What this means is that we can use FLT as a primality test. Let's say we want to determine if a number n is prime.
If we can find a witness w (which is not a multiple of n) where w^(n-1) % n /= 1 then we know for certain that n is not prime.
Use the function power_mod as a primality test to identify the composite (not prime) numbers in the file nums. Do this without modifying the file FLT.c, or by writting any additional C files.
Hint: 2 is a witness for all of the composite numbers in the file nums.
To complete this lab you will likely need to know how to do the following
Created by William Scarbro 1/11/2023