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.

A215674 a(1) = 1, a(n) = 2 if 1

Original entry on oeis.org

1, 2, 2, 4, 4, 3, 5, 5, 3, 7, 7, 5, 9, 9, 5, 8, 8, 4, 9, 9, 6, 11, 11, 6, 9, 9, 4, 11, 11, 8, 15, 15, 8, 13, 13, 6, 15, 15, 10, 19, 19, 10, 15, 15, 6, 14, 14, 9, 17, 17, 9, 13, 13, 5, 14, 14, 10, 19, 19, 10, 16, 16, 7, 18, 18, 12, 23, 23, 12, 18, 18, 7, 16
Offset: 1

Views

Author

Sung-Hyuk Cha, Aug 20 2012

Keywords

Comments

In the S.-H. Cha reference this is function fog_3(n).

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; 1+ `if`(n=1, 0, `if`(n<=3, 1,
          `if`(irem(n, 3, 'r')=0, a(r), a(r)+a(r+1))))
        end:
    seq (a(n), n=1..80);  # Alois P. Heinz, Aug 23 2012
  • Mathematica
    a[n_] := a[n] = If[n < 3, n, {q, r} = QuotientRemainder[n, 3];
         Switch[r, 0, a[q] + 1, 1|2, a[q] + a[q+1] + 1]];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Apr 24 2022 *)