cp's OEIS Frontend

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.

A171917 Van Eck sequence (cf. A181391) starting with a(1) = 7.

This page as a plain text file.
%I A171917 #14 Dec 21 2021 12:17:15
%S A171917 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,
%T A171917 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,
%U A171917 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
%N A171917 Van Eck sequence (cf. A181391) starting with a(1) = 7.
%C A171917 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. - _M. F. Hasler_, Jun 15 2019
%F A171917 a(n+1) = A181391(n) until the first occurrence of a(1) = 7 in A181391. - _M. F. Hasler_, Jun 15 2019
%o A171917 (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
%o A171917 (Python)
%o A171917 from itertools import count, islice
%o A171917 def A171917gen(): # generator of terms
%o A171917     b, bdict = 7, {7:(1,)}
%o A171917     for n in count(2):
%o A171917         yield b
%o A171917         if len(l := bdict[b]) > 1:
%o A171917             b = n-1-l[-2]
%o A171917         else:
%o A171917             b = 0
%o A171917         if b in bdict:
%o A171917             bdict[b] = (bdict[b][-1],n)
%o A171917         else:
%o A171917             bdict[b] = (n,)
%o A171917 A171917_list = list(islice(A171917gen(),20)) # _Chai Wah Wu_, Dec 21 2021
%Y A171917 Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).
%K A171917 nonn
%O A171917 1,1
%A A171917 _N. J. A. Sloane_, Oct 22 2010
%E A171917 Name edited and cross-references added by _M. F. Hasler_, Jun 15 2019