title: Sum of First 1000 primes not correct? what's wrong?
body: <p>Here is what I have  </p>
  
  <pre><code>public class SumOfPrimes {
      public static void main(String[] args) {
          long sum = 0;
          for (int i = 2; i &lt;= 1000; i++) {
              if (isPrime(i)) {
                  sum += i;
              }
          }
          System.out.println(sum);
      }
  
      private static boolean isPrime(final int number) {
          for (int i = 2; i * i &lt;= number; i++) {
              if (number % i == 0) {
                  return false;
              }
          }
          return true;
      }
  }  
  </code></pre>
  
  <p>What I get is  </p>
  
  <pre><code>76127
  </code></pre>
  
  <p>However the correct answer is  </p>
  
  <pre><code>3682913
  </code></pre>
  
  <p>Reference: <a href="http://www.wolframalpha.com/input/?i=sum+first+1000+prime+numbers&amp;x=0&amp;y=0" rel="nofollow">http://www.wolframalpha.com/input/?i=sum+first+1000+prime+numbers&amp;x=0&amp;y=0</a></p>
  
  <p>I am not able to spot bug in my code, any help here?</p>