Jump to content

Ludic numbers: Difference between revisions

m
(Added Lua version)
Line 1,468:
local first25, under1k, inRange, tripList, triplets = {}, 0, {}, {}, {}
for k, v in pairs(ludics(30000)) do
if k <= 25 then table.insert(first25, v) end
if v <= 1000 then under1k = under1k + 1 end
if k >= 2000 and k <= 2005 then table.insert(inRange, v) end
Line 1,483:
show("Triplets:", triplets)</lang>
{{out}}
<pre>First 25: 1 2 3 5 7 11 13 17 23 25 29 37 41 43 47 53 61 67 71 77 83 89 91 97 107
 
142 are less than or equal to 1000
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.