title: Java program to find perfect numbers below 10,000
body: <p>I am currently working on java code that will allow me to print out all perfect numbers below 10,000.  My issue is that I can not figure out why my code is not printing 6, but is printing all the other perfect numbers.  My code is below, please send help if you can see what I have over looked.  Thank you, </p>
  
  <pre><code>int min = 1;
  int max = 10000;
  
  for (min = 1; min &lt;= max; min++) {
      int sum = 0;
      int e = 1;
      for (e = 1; e &lt; min; e++) {
          int a = min % e;
  
          if (a == 0) {
              sum += e;
          }
      } 
      if (sum == min){           
          System.out.println(sum);
      }         
  }     
  </code></pre>