A171917 Van Eck sequence (cf. A181391) starting with a(1) = 7.
7, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, 0, 5, 15, 20, 0, 4, 32, 0, 3, 11, 18, 0, 4, 7, 66, 0, 4, 4, 1, 20, 16, 0, 6, 32, 17, 36, 0, 5, 26, 0, 3, 22, 0, 3, 3, 1, 17
Offset: 1
Keywords
Programs
-
PARI
A171917_vec(N, a=7, 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 A171917gen(): # generator of terms b, bdict = 7, {7:(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,) A171917_list = list(islice(A171917gen(),20)) # Chai Wah Wu, Dec 21 2021
Formula
Extensions
Name edited and cross-references added by M. F. Hasler, Jun 15 2019
Comments