login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A171918 Van Eck sequence (cf. A181391) starting with a(1) = 8. 10

%I #16 Dec 21 2021 12:16:21

%S 8,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 5,15,0,5,3,5,2,17,0,6,11,0,3,8,47,0,4,24,0,3,7,0,3,3,1,49,0,5,22,0,3,

%U 7,11,22,5,7,4,20,0,9,46,0,3,12,0,3,3,1,23,0,5,16,0,3,7,19,0,4

%N Van Eck sequence (cf. A181391) starting with a(1) = 8.

%C 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 12 2019

%F a(n+1) = A181391(n) up to the first occurrence of a(1) = 8 in A181391. - _M. F. Hasler_, Jun 15 2019

%o (PARI) A171918_vec(N,a=8,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 11 2019

%o (Python)

%o from itertools import count, islice

%o def A171918gen():

%o yield 8

%o b, bdict = 8, {8:(1,)}

%o for n in count(2):

%o if len(l := bdict[b]) > 1:

%o b = n-1-l[-2]

%o else:

%o b = 0

%o if b in bdict:

%o bdict[b] = (bdict[b][-1],n)

%o else:

%o bdict[b] = (n,)

%o yield b

%o A171918_list = list(islice(A171918gen(),30)) # _Chai Wah Wu_, Dec 21 2021

%Y Cf. A181391, A171911, ..., A171917 (same but starting with 0, 1, ..., 7).

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Oct 22 2010

%E Name edited and cross-references added by _M. F. Hasler_, Jun 12 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)