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.

Showing 1-2 of 2 results.

A171911 Van Eck's sequence (cf. A181391), but starting with a(1) = 1.

Original entry on oeis.org

1, 0, 0, 1, 3, 0, 3, 2, 0, 3, 3, 1, 8, 0, 5, 0, 2, 9, 0, 3, 9, 3, 2, 6, 0, 6, 2, 4, 0, 4, 2, 4, 2, 2, 1, 23, 0, 8, 25, 0, 3, 19, 0, 3, 3, 1, 11, 0, 5, 34, 0, 3, 7, 0, 3, 3, 1, 11, 11, 1, 3, 5, 13, 0, 10, 0, 2, 33, 0, 3, 9, 50, 0, 4, 42, 0, 3, 7, 25, 40, 0, 5, 20, 0, 3, 8, 48, 0, 4, 15
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

After the initial value, the sequence is extended by a(n+1) = min { k > 0: a(n-k) = a(n) } or 0 if no such k exists, i.e., if a(n) did not appear earlier.

Crossrefs

Cf. A181391, A171912, A171913, A171914, A171915, A171916, A171917, A171918 (same but starting with 0, 2, ..., 8).

Programs

  • Mathematica
    t = {1};
    Do[
    d = Quiet[Check[Position[t, Last[t]][[-2]][[1]], 0], Part::partw];
    If[d == 0, x = 0, x = Length[t] - d];
    AppendTo[t, x], 100]
    t (* Horst H. Manninger, Aug 03 2020 *)
  • PARI
    A171911_vec(N,a=1,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
  • Python
    A171911_list, l = [1, 0], 0
    for n in range(1, 10**4):
        for m in range(n-1, -1, -1):
            if A171911_list[m] == l:
                l = n-m
                break
        else:   # break did not occur
            l = 0
        A171911_list.append(l) # Chai Wah Wu, Jan 02 2015
    

Extensions

Edited by M. F. Hasler, Jun 11 2019

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

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

Crossrefs

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

Programs

  • 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
    
  • Python
    from itertools import count, islice
    def A171918gen():
        yield 8
        b, bdict = 8, {8:(1,)}
        for n in count(2):
            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,)
            yield b
    A171918_list = list(islice(A171918gen(),30)) # Chai Wah Wu, Dec 21 2021

Formula

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

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 12 2019
Showing 1-2 of 2 results.