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.

A050029 a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = 1 and a(3) = 2.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 9, 10, 11, 21, 30, 37, 41, 44, 46, 47, 48, 95, 141, 185, 226, 263, 293, 314, 325, 335, 344, 351, 355, 358, 360, 361, 362, 723, 1083, 1441, 1796, 2147, 2491, 2826, 3151, 3465, 3758, 4021, 4247, 4432, 4573, 4668, 4716
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A006257, A050025 (similar, but with different initial conditions).

Programs

  • Maple
    a := proc(n) option remember;
    `if`(n < 4, [1, 1, 2][n], a(n - 1) + a(Bits:-Iff((n - 2) $ 2) + 3 - n));
    end proc;
    seq(a(n), n = 1 .. 50); # Petros Hadjicostas, Nov 07 2019
  • Mathematica
    Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 2}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* Ivan Neretin, Sep 06 2015 *)

Formula

From Petros Hadjicostas, Nov 08 2019: (Start)
a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + a(n-1) for n >= 4.
a(n) = a(n - 1 - A006257(n-2)) + a(n-1) for n >= 4. (End)

Extensions

Name edited by Petros Hadjicostas, Nov 07 2019