Pseudocode for naive primality test: boolean naive_primality_test input: an positive integer n output: true if n is a prime number and false otherwise a = 2 while a < n // test if n is divisible by a // (the symbol % means modular reduction and you may assume that it is implemented using a division, a multiplication, and a subtraction) if 0 == n % a return false a += 1 return true