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.

A120503 Generalized meta-Fibonacci sequence a(n) with parameters s=0 and k=3.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51
Offset: 1

Views

Author

Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca), Jun 20 2006

Keywords

References

  • Callaghan, Joseph, John J. Chew III, and Stephen M. Tanny. "On the behavior of a family of meta-Fibonacci sequences." SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See T_{0,3} with initial values 0,0,1, and plotted in Fig. 1.5. This is essentially the same sequence. - N. J. A. Sloane, Apr 16 2014

Crossrefs

Programs

  • Maple
    a := proc(n)
    option remember;
    if n <= 1 then return 1 end if;
    if n <= 3 then return n end if;
    return add(a(n - i + 1 - a(n - i)), i = 1 .. 3)
    end proc
  • Mathematica
    a[n_] := a[n] = If[1 <= n <= 3, n, Sum[a[n-i+1 - a[n-i]], {i, 1, 3}]];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Aug 02 2022 *)
  • PARI
    {a(n)=local(A); if(n<=3, max(0, n), A=vector(n, i, i); for(k=4, n, A[k]=A[k-A[k-1]]+A[k-1-A[k-2]]+A[k-2-A[k-3]]); A[n])} /* Michael Somos, Aug 31 2006 */
    
  • PARI
    apply( A120503(n)={my(s=sumdigits(n*=2, 3)\2); n\=3; while(s>0, s-=valuation(n++, 3)+1); n}, [1..99]) \\ M. F. Hasler, Dec 27 2019

Formula

If n = 1, a(n)=1. If 2 <= n <= 3, then a(n)=n. If n>3 then a(n)=a(n-a(n-1)) + a(n-1-a(n-2)) + a(n-2-a(n-3))
G.f.: A(z) = z / (1 - z) * prod( (1 - z^(3 * [i])) / (1 - z^[i]), i=1..infinity), where [i] = (3^i - 1) / 2.
a(n) = A007844(n)/3. - Michel Marcus, Aug 19 2013, conjectured. This is true: see the analogous sequence A007843 for a sketch of the proof. - M. F. Hasler, Dec 27 2019