OFFSET
1,2
COMMENTS
After the initial value, the sequence is extended by a(n+1) = min { k > 0: a(n-k) = a(n) } or 2 if no such k exists, i.e., if a(n) did not appear earlier.
Although the sequence has properties that are superficially similar to the original A181391, there is an important difference. Using a positive number m instead of 0 to mark a new value means there is no 1-to-1 correspondence between the occurrence of a new value and the occurrence of m. - Jan Ritsema van Eck, Aug 14 2019
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..25000
PROG
(Python)
from itertools import count, islice
def A309363gen(): # generator of terms
b, bdict = 0, {0:(1, )}
for n in count(2):
yield b
if len(l := bdict[b]) > 1:
b = n-1-l[-2]
else:
b = 2
if b in bdict:
bdict[b] = (bdict[b][-1], n)
else:
bdict[b] = (n, )
A309363_list = list(islice(A309363gen(), 20)) # Chai Wah Wu, Dec 21 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Nicholas FitzGerald, Jul 25 2019
STATUS
approved