Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,10 +1,11 @@
local a = {[0]=0}
local used = {[0]=true}
local used1000 = {[0]=true}
local count1000 = 1
local foundDup = false
local n = 1
while n<=15 or not foundDup or #used1000<1001 do
while n<=15 or not foundDup or count1000 <1001 do
local nxt = a[n - 1] - n
if nxt<1 or used[nxt] ~= nil then
nxt = nxt + 2 * n
@ -14,7 +15,10 @@ while n<=15 or not foundDup or #used1000<1001 do
if not alreadyUsed then
used[nxt] = true
if 0<=nxt and nxt<=1000 then
used1000[nxt] = true
if not used1000[nxt] then
used1000[nxt] = true
count1000 = count1000 + 1
end
end
end
if n==14 then
@ -28,7 +32,7 @@ while n<=15 or not foundDup or #used1000<1001 do
print("The first duplicated term is a["..n.."] = "..nxt)
foundDup = true
end
if #used1000 == 1001 then
if count1000 == 1001 then
print("Terms up to a["..n.."] are needed to generate 0 to 1000")
end
n = n + 1