login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358403
The index of A358402 where n first appears, or 0 if n never appears.
3
1, 3, 6, 9, 25, 21, 17, 109, 198, 67, 860, 114, 148, 261, 57, 137, 82, 37, 52, 215, 447, 43, 105, 404, 267, 163, 414, 94, 154, 1292, 184, 716, 142, 669, 243, 73, 1685, 126, 360, 209, 329, 324, 355, 88, 542, 300, 887, 366, 422, 492, 1053, 1754, 256, 941, 946, 711, 679, 178, 283, 3273, 2221, 225
OFFSET
0,2
COMMENTS
See A358402 for further details.
PROG
(Python)
from itertools import count, islice
def agen():
k, an, first, prev = 0, 0, {0: 1}, {0: 1}
for n in count(2):
while k in first: yield first[k]; k += 1
an1 = 0 if first[an] == n-1 else min(n-1-prev[an], first[an])
if an1 not in first: first[an1] = prev[an1] = n
prev[an] = n-1
an = an1
print(list(islice(agen(), 62))) # Michael S. Branicky, Nov 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Nov 14 2022
STATUS
approved