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.

A116591 a(n) = b(n+2) + b(n) with a(0) = 1, where b(n) = A005229(n) for n>2.

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 10, 11, 13, 13, 15, 16, 18, 19, 21, 22, 23, 25, 26, 28, 30, 31, 33, 33, 35, 36, 37, 39, 39, 41, 42, 44, 46, 47, 49, 50, 51, 53, 54, 56, 57, 59, 59, 60, 61, 62, 64, 66, 68, 70, 71, 73, 73, 75, 76, 77, 79, 80, 82, 84, 85, 87, 88, 89, 90, 91, 91, 93, 94, 96, 98
Offset: 0

Views

Author

Roger L. Bagula, Mar 27 2006

Keywords

Comments

A similar definition applied to the Fibonacci sequence (A000045) leads to the Lucas sequence (A000032).

Crossrefs

Programs

  • Maple
    b:=proc(n) option remember; if n<=2 then 1 else b(b(n-2))+b(n-b(n-2)): fi: end: seq(b(n),n=1..75): a[0]:=1: for n from 1 to 70 do a[n]:=b(n)+b(n+2) od: seq(a[n],n=0..70);
  • Mathematica
    M[n_]:= M[n]= If[n<3, 1 -Boole[n==0], M[M[n-2]] + M[n -M[n-2]]];
    L[n_]:= L[n]= If[n==1, 1, M[n-1] + M[n+1]];
    Table[L[n], {n, 100}] (* modified by G. C. Greubel, Mar 28 2022 *)
  • Sage
    @CachedFunction
    def b(n): # A005229
        if (n<3): return 1
        else: return b(b(n-2)) + b(n-b(n-2))
    def A116591(n): return b(n+2) +b(n) -bool(n==0)
    [A116591(n) for n in (0..100)] # G. C. Greubel, Mar 28 2022

Formula

a(n) = A005229(n+2) + A005229(n) for n>=1.

Extensions

Edited by N. J. A. Sloane, Apr 15 2006