A171916 Van Eck's sequence (cf. A181391) starting with a(1) = 6.
6, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 10, 0, 6, 3, 0, 3, 2, 9, 0, 4, 0, 2, 5, 0, 3, 9, 8, 0, 4, 9, 4, 2, 10, 22, 0, 7, 0, 2, 6, 26, 0, 4, 11, 0, 3, 20, 0, 3, 3, 1, 41, 0, 5, 30, 0, 3, 7, 21, 0, 4, 18, 0, 3, 7, 7, 1, 16, 0, 6, 30, 16, 4, 12, 0, 6, 6, 1, 11, 35, 0, 6, 5, 29, 0, 4, 13, 0, 3, 25, 0
Offset: 1
Keywords
Programs
-
PARI
A171916_vec(N, a=6, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n), a))} \\ M. F. Hasler, Jun 15 2019
-
Python
from itertools import count, islice def A171916gen(): # generator of terms b, bdict = 6, {6:(1,)} for n in count(2): yield b if len(l := bdict[b]) > 1: b = n-1-l[-2] else: b = 0 if b in bdict: bdict[b] = (bdict[b][-1],n) else: bdict[b] = (n,) A171916_list = list(islice(A171916gen(),20)) # Chai Wah Wu, Dec 21 2021
Extensions
Name edited and cross-references added by M. F. Hasler, Jun 15 2019
Comments