Perfect numbers: Difference between revisions

no edit summary
m (Take "See also" off the TOC and rm the explicit TOC)
No edit summary
Line 289:
=={{header|Haskell}}==
<lang haskell>perf n = n == sum [i | i <- [1..n-1], n `mod` i == 0]</lang>
 
=={{header|HicEst}}==
<lang HicEst> DO i = 1, 1E4
IF( perfect(i) ) WRITE() i
ENDDO
END ! end of "main"
 
FUNCTION perfect(n)
sum = 1
DO i = 2, n^0.5
sum = sum + (MOD(n, i) == 0) * (i + INT(n/i))
ENDDO
perfect = sum == n
END</lang>
 
=={{header|J}}==
Anonymous user