Abundant, deficient and perfect number classifications: Difference between revisions
Content added Content deleted
m (→{{header|Fortran}}: remove leading spaces from the source: confusion over layout.) |
(GP) |
||
Line 536: | Line 536: | ||
Abundant : 4953 |
Abundant : 4953 |
||
</pre> |
</pre> |
||
=={{header|PARI/GP}}== |
|||
<lang parigp>classify(k)= |
|||
{ |
|||
my(v=[0,0,0],t); |
|||
for(n=1,k, |
|||
t=sigma(n,-1); |
|||
if(t<2,v[1]++,t>2,v[3]++,v[2]++) |
|||
); |
|||
v; |
|||
} |
|||
classify(20000)</lang> |
|||
{{out}} |
|||
<pre>%1 = [15043, 4, 4953]</pre> |
|||
=={{header|Pascal}}== |
=={{header|Pascal}}== |