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”).

A358406
The index of A358405 where n first appears, or 0 if n never appears.
3
1, 3, 5, 10, 16, 8, 19, 141, 14, 190, 25, 22, 416, 70, 54, 162, 32, 308, 169, 67, 93, 203, 118, 513, 196, 29, 40, 200, 861, 37, 74, 1081, 82, 216, 208, 363, 90, 46, 375, 1675, 1091, 333, 1407, 812, 166, 78, 51, 1099, 115, 193, 1243, 64, 595, 98, 58, 367, 617, 235, 325, 766, 2137, 272, 124
OFFSET
0,2
COMMENTS
See A358405 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 max(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(), 63))) # Michael S. Branicky, Nov 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Nov 14 2022
STATUS
approved