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.

A171915 Van Eck sequence (cf. A181391) starting with a(1) = 5.

Original entry on oeis.org

5, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 12, 0, 3, 0, 2, 9, 0, 3, 5, 9, 4, 0, 5, 4, 3, 7, 0, 5, 5, 1, 23, 0, 5, 4, 10, 0, 4, 3, 13, 0, 4, 4, 1, 13, 5, 12, 35, 0, 8, 0, 2, 36, 0, 3, 16, 0, 3, 3, 1, 16, 5, 16, 2, 12, 18, 0, 10, 32, 0, 3, 12, 7, 46, 0, 5, 14, 0, 3, 8, 30, 0, 4, 40, 0, 3, 7
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, i.e., a(n) does not appear earlier in the sequence. - M. F. Hasler, Jun 15 2019

Crossrefs

Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).

Programs

  • PARI
    A171915_vec(N, a=5, 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
    A171915_list, l = [5, 0], 0
    for n in range(1, 10**4):
        for m in range(n-1, -1, -1):
            if A171915_list[m] == l:
                l = n-m
                break
        else:
            l = 0
        A171915_list.append(l) # Chai Wah Wu, Jan 02 2015
    

Extensions

Name and other sections edited by M. F. Hasler, Jun 15 2019