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)
Line 787: Line 787:


-- First 50
-- First 50
local count, x = 1, 0
local count, x = 0, 0
while count <= 50 do
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 <= 50000 do
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
count = count + 1
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
count = count + 1
end
end
end
end