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.

A134586 a(n) = a(n-1) + A007954(n-1) if a(n-1) is odd, otherwise a(n) = a(n-1) / 2.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 7, 14, 7, 16, 8, 4, 2, 1, 5, 10, 5, 12, 6, 3, 3, 5, 9, 15, 23, 33, 45, 59, 75, 93, 93, 96, 48, 24, 12, 6, 3, 24, 12, 6, 3, 7, 15, 27, 43, 63, 87, 115, 147, 183, 183, 188, 94, 47, 67, 92, 46, 23, 63, 108, 54, 27, 39, 57, 81, 111, 147, 189, 237, 291, 291, 298, 149
Offset: 1

Views

Author

Ctibor O. Zizka, Jan 24 2008

Keywords

Crossrefs

Cf. A007954.

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,If[EvenQ[a],a/2,a+Times@@IntegerDigits[n+1]]}; Transpose[ NestList[nxt,{0,1},80]][[2]] (* Harvey P. Dale, Sep 11 2015 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = if (va[n-1] % 2, va[n-1] + vecprod(digits(n-1)), va[n-1]/2);); va;} \\ Michel Marcus, Nov 28 2020

Extensions

Name corrected by Michel Marcus, Nov 28 2020