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.

A050025 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) = a(3) = 1.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 6, 7, 8, 15, 21, 26, 29, 31, 32, 33, 34, 67, 99, 130, 159, 185, 206, 221, 229, 236, 242, 247, 250, 252, 253, 254, 255, 509, 762, 1014, 1264, 1511, 1753, 1989, 2218, 2439, 2645, 2830, 2989, 3119, 3218, 3285, 3319
Offset: 1

Views

Author

Keywords

Programs

  • Maple
    a := proc(n) option remember;
    `if`(n < 4, 1, a(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n)); end proc;
    seq(a(n), n = 1 .. 48); # Petros Hadjicostas, Nov 08 2019
  • Mathematica
    Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 1}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* Ivan Neretin, Sep 06 2015 *)
  • PARI
    lista(nn) = {nn = max(nn,3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 1; for(n=4, nn, va[n] = va[n-1] + va[2*2^logint(n-2, 2) + 2 - n]); va;} \\ Petros Hadjicostas, May 03 2020

Extensions

Name edited by Petros Hadjicostas, Nov 08 2019