Abundant odd numbers: Difference between revisions

→‎{{header|Pascal}}: insert PariGP section
(→‎{{header|Pascal}}: insert PariGP section)
Line 3,924:
The first odd abundant number greater than 1000000000 is 1000000575.
The sum of its proper divisors is 1083561009.
</pre>
 
=={{header|PariGP}}==
<pre>
genit(brk1,brk2,brk3)={tcnt=0;
print("First 25 abundant odd numbers:");
forstep(n=1,999999999999999999,2,
if(tcnt==brk2&&n<brk3,next);
if(sigma(n)<=2*n,next);
tcnt+=1;
if(tcnt>brk1&&tcnt<brk2,next);
if(n>=brk3 && sigma(n)>2*n,print("The first odd abundant number greater than 1000000000 is ",n," with sigma = ",sigma(n) );break);
if(tcnt==brk2,print("The 1000th odd abundant number is ",n," with sigma = ",sigma(n) );next);
print(n," with sigma = ",sigma(n)));}
<\pre>
{{out}}
<pre>
(11:14) gp > genit(25,1000,1000000000 )
First 25 abundant odd numbers:
945 with sigma = 1920
1575 with sigma = 3224
2205 with sigma = 4446
2835 with sigma = 5808
3465 with sigma = 7488
4095 with sigma = 8736
4725 with sigma = 9920
5355 with sigma = 11232
5775 with sigma = 11904
5985 with sigma = 12480
6435 with sigma = 13104
6615 with sigma = 13680
6825 with sigma = 13888
7245 with sigma = 14976
7425 with sigma = 14880
7875 with sigma = 16224
8085 with sigma = 16416
8415 with sigma = 16848
8505 with sigma = 17472
8925 with sigma = 17856
9135 with sigma = 18720
9555 with sigma = 19152
9765 with sigma = 19968
10395 with sigma = 23040
11025 with sigma = 22971
The 1000th odd abundant number is 492975 with sigma = 1012336
The first odd abundant number greater than 1000000000 is 1000000575 with sigma = 2083561584
(11:24) gp >
</pre>
 
23

edits