Anonymous user
Arithmetic numbers: Difference between revisions
→{{header|Lua}}
Line 854:
local hundr = {1}
for n = 2,
local f = factors (n)
local s = sum (f)
Line 872:
elseif arithmetic_count == 1000
or arithmetic_count == 10000
or arithmetic_count == 100000 then
or arithmetic_count == 1000000 then▼
print (arithmetic_count..'th arithmetic number is '..(n))
print ('Number of composite arithmetic numbers <= '..(n)..': '..composite_count)
print (arithmetic_count..'th arithmetic number is '..(n))
print ('Number of composite arithmetic numbers <= '..(n)..': '..composite_count)
return
end
end
Line 895 ⟶ 898:
100000th arithmetic number is 125587
Number of composite arithmetic numbers <= 125587: 88219
1000000th arithmetic number is 1228663
(Done in 35.94 seconds)</pre>▼
Number of composite arithmetic numbers <= 1228663: 905043
=={{header|Pascal}}==
|