Numbers which are the cube roots of the product of their proper divisors: Difference between revisions
Content added Content deleted
m (→{{header|Free Pascal}}: sieve limit must be 2*3 not 2^3) |
m (→{{header|Lua}}) |
||
Line 787: | Line 787: | ||
-- First 50 |
-- First 50 |
||
local count, x = |
local count, x = 0, 0 |
||
while count < |
while count < 50 do |
||
x = x + 1 |
x = x + 1 |
||
if is_1_or_has_eight_divisors(x) then |
if is_1_or_has_eight_divisors(x) then |
||
Line 797: | Line 797: | ||
-- 500th, 5,000th and 50,000th |
-- 500th, 5,000th and 50,000th |
||
while count < |
while count < 50000 do |
||
x = x + 1 |
x = x + 1 |
||
if is_1_or_has_eight_divisors(x) then |
if is_1_or_has_eight_divisors(x) then |
||
⚫ | |||
if count == 500 then print("\n\n500th: " .. x) end |
if count == 500 then print("\n\n500th: " .. x) end |
||
if count == 5000 then print("5,000th: " .. x) end |
if count == 5000 then print("5,000th: " .. x) end |
||
⚫ | |||
end |
end |
||
end |
end |