Perfect numbers: Difference between revisions
Content added Content deleted
(Added Oz.) |
|||
Line 286: | Line 286: | ||
for(BigInteger i= BigInteger.ONE; |
for(BigInteger i= BigInteger.ONE; |
||
i.compareTo(n) < 0;i=i.add(BigInteger.ONE)){ |
i.compareTo(n) < 0;i=i.add(BigInteger.ONE)){ |
||
if(n.mod(i). |
if(n.mod(i).equals(BigInteger.ZERO)){ |
||
sum= sum.add(i); |
sum= sum.add(i); |
||
} |
} |
||
} |
} |
||
return sum. |
return sum.equals(n); |
||
}</lang> |
}</lang> |
||