Anonymous user
Abundant, deficient and perfect number classifications: Difference between revisions
Abundant, deficient and perfect number classifications (view source)
Revision as of 19:35, 23 April 2015
, 9 years agoGP
m (→{{header|Fortran}}: remove leading spaces from the source: confusion over layout.) |
(GP) |
||
Line 536:
Abundant : 4953
</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}}==
|