OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
PROG
(Python)
from itertools import count
def A372052(n):
a, aset = 1, {0, 1}
for p in count(3, 2):
if a == n:
return p>>1
for b in count(a%p, p):
if b not in aset:
aset.add(b)
a = b
break # Chai Wah Wu, Apr 17 2024
(Python) # faster for initial segment of sequence
adict, n = dict(), 1
for i, v in enumerate(A370952_gen(), 1):
if v >= n and v not in adict:
adict[v] = i
while n in adict:
yield adict[n]; del adict[n]; n += 1
print(list(islice(A372052_gen(), 63))) # Michael S. Branicky, Apr 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 17 2024
EXTENSIONS
More terms from Chai Wah Wu, Apr 17 2024
STATUS
approved