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.

A050020 a(n) = floor(a(n-1)/2) if this is positive and not yet in the sequence, otherwise a(n) = 10*a(n-1).

Original entry on oeis.org

1, 10, 5, 2, 20, 200, 100, 50, 25, 12, 6, 3, 30, 15, 7, 70, 35, 17, 8, 4, 40, 400, 4000, 2000, 1000, 500, 250, 125, 62, 31, 310, 155, 77, 38, 19, 9, 90, 45, 22, 11, 110, 55, 27, 13, 130, 65, 32, 16, 160, 80, 800, 8000, 80000, 40000, 20000
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A050000 and references therein.

Programs

  • Mathematica
    Rest@Nest[Append[#, If[MemberQ[#, c = Quotient[#[[-1]], 2]], 10*#[[-1]], c]] &, {0, 1}, 54] (* Ivan Neretin, Sep 06 2015 *)
  • PARI
    first(n)=my(v=vector(n), t); v[1]=1; for(i=2, n, t=v[i-1]\2; if(t<2, v[i]=10*v[i-1]; next); for(j=1, i-1, if(v[j]==t, v[i]=10*v[i-1]; next(2))); v[i]=t); v \\ Charles R Greathouse IV, Jul 31 2016