Abundant odd numbers: Difference between revisions

Content added Content deleted
Line 2,775: Line 2,775:


=={{header|Frink}}==
=={{header|Frink}}==
Frink contains efficient functions for finding the factors of a number. It uses trial division, wheel factorization, and Pollard rho factorization.

<lang frink>isAbundantOdd[n] := sum[allFactors[n, true, false]] > n
<lang frink>isAbundantOdd[n] := sum[allFactors[n, true, false]] > n


Line 2,796: Line 2,794:


println["\nThe thousandth abundant odd number:"]
println["\nThe thousandth abundant odd number:"]
n = 3
n = 1
count = 0
count = 0
do
do
{
{
n = n + 2

if isAbundantOdd[n]
if isAbundantOdd[n]
count = count + 1
count = count + 1


n = n + 2
} until count == 1000
} until count == 1000


Line 2,816: Line 2,815:
until isAbundantOdd[n]
until isAbundantOdd[n]


println["$n: proper divisor sum " + sum[allFactors[n, 1, false]]]</lang>
println["$n: proper divisor sum " + sum[allFactors[n, 1, false]]]
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 2,847: Line 2,848:


The thousandth abundant odd number:
The thousandth abundant odd number:
492977: proper divisor sum 1423
492975: proper divisor sum 519361


The first abundant odd number over 1 billion:
The first abundant odd number over 1 billion: