Abundant odd numbers: Difference between revisions

no edit summary
(→‎{{header|Factor}}: [ cdr ] times car -> lnth)
No edit summary
Line 3,911:
"First abundant odd number > 10^9 is 1000000575, its sum of divisors is 2083561584, and its sum of proper divisors is 1083561009"
</pre>
 
=={{header|Mathematica}}==
 
<lang Mathematica>ClearAll[AbundantQ]
AbundantQ[n_] := TrueQ[Greater[Total @ Most @ Divisors @ n, n]]
res = {};
i = 1;
While[Length[res] < 25,
If[AbundantQ[i],
AppendTo[res, {i, Total @ Most @ Divisors @ i}];
];
i += 2;
];
res
 
res = {};
i = 1;
While[Length[res] < 1000,
If[AbundantQ[i],
AppendTo[res, {i, Total @ Most @ Divisors @ i}];
];
i += 2;
];
res[[-1]]
 
res = {};
i = 1000000001;
While[Length[res] < 1,
If[AbundantQ[i],
AppendTo[res, {i, Total @ Most @ Divisors @ i}];
];
i += 2;
];
res</lang>
{{out}}
<pre>{{945,975},{1575,1649},{2205,2241},{2835,2973},{3465,4023},{4095,4641},{4725,5195},{5355,5877},{5775,6129},{5985,6495},{6435,6669},{6615,7065},{6825,7063},{7245,7731},{7425,7455},{7875,8349},{8085,8331},{8415,8433},{8505,8967},{8925,8931},{9135,9585},{9555,9597},{9765,10203},{10395,12645},{11025,11946}}
{492975, 519361}
{{1000000575,1083561009}}</pre>
 
=={{header|Maxima}}==
1,111

edits