I have been having trouble with prim numbers as well, but in my assignment I have to use the isPrime function to find the prime numbers from 2 to 1000000. I also have to use power2 because we arent allowed to use the pow function since its all integers, to find the mersenne primes which are, when raising a prime number to 2 then subtracting 1 = a prime number. If anyone could help me out on this it would be appreciated because I am struggling, thank you
well first I am having trouble with the isPrime function to find and print all the prime numers from 2 to 1000000. thats the first part I am having trouble with
isPrime returns true when the passed number is a prime and false otherwise.
So just keep calling it in a loop for each number. I don't see the problem.