A309363 Van Eck's sequence (cf. A181391), but outputting 2 for a new number, not 0.
0, 2, 2, 1, 2, 2, 1, 3, 2, 3, 2, 2, 1, 6, 2, 3, 6, 3, 2, 4, 2, 2, 1, 10, 2, 3, 8, 2, 3, 3, 1, 8, 5, 2, 6, 18, 2, 3, 8, 7, 2, 4, 22, 2, 3, 7, 6, 12, 2, 5, 17, 2, 3, 8, 15, 2, 4, 15, 3, 6, 13, 2, 6, 3, 5, 15, 8, 13, 7, 23, 2, 9, 2, 2, 1, 44
Offset: 1
Keywords
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..25000
Crossrefs
Programs
-
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
Comments