Guest User

Untitled

a guest
Apr 8th, 2017
1,109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. private static void initFactors() {
  2.         Arrays.fill(factors, 0, MAX, 1);
  3.  
  4.         int x= (int) Math.sqrt(MAX);
  5.        
  6.         for (int i = 2; i<=x ; i++) {
  7.  
  8.             for (int j = i; j < MAX; j += i) {
  9.  
  10.                 if ((j%i)==0)
  11.                     factors[j]++;
  12.             }
  13.         }
  14.     }
Add Comment
Please, Sign In to add comment