RosettaCodeData/Task/Super-d-numbers/Lua/super-d-numbers-1.lua
2026-04-30 12:34:36 -04:00

10 lines
287 B
Lua

for d = 2, 5 do
local n, found = 0, {}
local dds = string.rep(d, d)
while #found < 10 do
local dnd = string.format("%15.f", d * n ^ d)
if string.find(dnd, dds) then found[#found+1] = n end
n = n + 1
end
print("super-" .. d .. ": " .. table.concat(found,", "))
end