Anonymous user
Abundant odd numbers: Difference between revisions
m
→{{header|Delphi}}: changed position of inc(N,2) to get the right solution for thousandth abundant odd number
No edit summary |
m (→{{header|Delphi}}: changed position of inc(N,2) to get the right solution for thousandth abundant odd number) |
||
Line 772:
C := 0;
while C < 25 do begin
Inc(N, 2);▼
if N < SumProperDivisors(N) then begin
Inc(C);
WriteLn(Format('%u: %u', [C, N]));
end;
▲ Inc(N, 2);
end;
while C < 1000 do begin
if N < SumProperDivisors(N) then Inc(C);▼
Inc(N, 2);
▲ if N < SumProperDivisors(N) then Inc(C);
end;
WriteLn(Format('The one thousandth abundant odd number is: %u', [N]));
Line 817:
24: 10395
25: 11025
The one thousandth abundant odd number is:
The first abundant odd number above one billion is: 1000000575
</pre>
|