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.

A171899 Backwards van Eck transform of A000002.

Original entry on oeis.org

0, 0, 1, 3, 1, 3, 2, 2, 1, 3, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 1, 3, 2, 2, 1, 3, 1, 3, 2, 1, 3, 2, 2, 1, 3, 2, 1, 3, 1, 3, 2, 2, 1, 3, 2, 2, 1, 3, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 1, 3, 2, 1, 3, 1, 3, 2, 1, 3, 2, 2, 1, 3, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 1, 3, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 1, 3
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

Given a sequence a, the backwards van Eck transform b is defined as follows: If a(n) has already appeared in a, let a(m) be the most recent occurrence, and set b(n)=n-m; otherwise b(n)=0.
The forwards van Eck transform of A000002 is A078929.

Crossrefs

Programs

  • Maple
    ECKb:=proc(a) local b,i,m,n;
    if whattype(a) <> list then RETURN([]); fi:
    b:=[0];
    for n from 2 to nops(a) do
    # has a(n) appeared before?
    m:=0;
    for i from n-1 by -1 to 1 do
    if (a[i]=a[n]) then m:=n-i; break; fi
    od:
    b:=[op(b),m];
    od:
    RETURN(b);
    end: