login
A366868
a(n) = A366470(A366864(n)-1).
1
0, 1, 0, 1, 6, 1, 6, 15, 24, 29, 22, 1, 0, 7, 6, 11, 48, 109, 0, 7, 66, 155, 54, 21, 16, 11
OFFSET
1,5
COMMENTS
Terms of A366470 at the end of a segment. Some values, e.g. 0, 1, 6, 7, 11, occur multiple times. Will they occur infinitely often?
PROG
(Python)
from itertools import count, islice
from sympy import nextprime
def A366868_gen(): # generator of terms
a, aset, p = 1, {0, 1}, 2
for i in count(3):
for b in count(a, p):
if b not in aset:
aset.add(b)
c = b%(p:=nextprime(p))
if c > a:
yield a
a = c
break
A366868_list = list(islice(A366868_gen(), 20))
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Chai Wah Wu, Oct 25 2023
STATUS
approved