Jump to content

Abundant, deficient and perfect number classifications: Difference between revisions

GP
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}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.