This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A171914 #14 Dec 21 2021 12:20:22 %S A171914 4,0,0,1,0,2,0,2,2,1,6,0,5,0,2,6,5,4,17,0,6,5,5,1,14,0,6,6,1,5,7,0,6, %T A171914 5,4,17,17,1,9,0,8,0,2,28,0,3,0,2,5,15,0,4,17,16,0,4,4,1,20,0,5,12,0, %U A171914 3,18,0,3,3,1,11,0,5,11,3,6,42,0,6,3,5,8,40,0,6,6,1,17,34,0,6 %N A171914 Van Eck sequence (cf. A181391) starting with a(1) = 4. %C A171914 A van Eck sequence is defined recursively by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty, i.e., a(n) does not appear earlier in the sequence. - _M. F. Hasler_, Jun 15 2019 %F A171914 a(n+1) = A181391(n) up to the first occurrence of a(1) = 4 in A181391. - _M. F. Hasler_, Jun 15 2019 %o A171914 (PARI) A171914_vec(N, a=4, 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 %o A171914 (Python) %o A171914 from itertools import count, islice %o A171914 def A171914gen(): # generator of terms %o A171914 b, bdict = 4, {4:(1,)} %o A171914 for n in count(2): %o A171914 yield b %o A171914 if len(l := bdict[b]) > 1: %o A171914 b = n-1-l[-2] %o A171914 else: %o A171914 b = 0 %o A171914 if b in bdict: %o A171914 bdict[b] = (bdict[b][-1],n) %o A171914 else: %o A171914 bdict[b] = (n,) %o A171914 A171914_list = list(islice(A171914gen(),20)) # _Chai Wah Wu_, Dec 21 2021 %Y A171914 Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8). %K A171914 nonn %O A171914 1,1 %A A171914 _N. J. A. Sloane_, Oct 22 2010 %E A171914 Name edited and cross-references added by _M. F. Hasler_, Jun 15 2019