You are both mistaken using ½ the number as the limit for
testing whether it is prime. You ought to use √number. You also should use a
Sieve of Eratosthenes to populate a boolean array and that will tell you whether a number is prime or not. Much faster and efficient than using the % operator. If you look in the Wikipedia article which appears from that link, there is the Sieve of Euler, too.