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.

A081172 Tribonacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3), with a(0) = 1, a(1) = 1, a(2) = 0.

Original entry on oeis.org

1, 1, 0, 2, 3, 5, 10, 18, 33, 61, 112, 206, 379, 697, 1282, 2358, 4337, 7977, 14672, 26986, 49635, 91293, 167914, 308842, 568049, 1044805, 1921696, 3534550, 6501051, 11957297, 21992898, 40451246, 74401441, 136845585, 251698272, 462945298, 851489155
Offset: 0

Views

Author

Harry J. Smith, Apr 19 2003

Keywords

Comments

The name "tribonacci number" is less well-defined than "Fibonacci number". The sequence A000073 (which begins 0, 0, 1) is probably the most important version, but the name has also been applied to A000213, A001590, and A081172. - N. J. A. Sloane, Jul 25 2024
Completes the set of tribonacci numbers starting with 0's and 1's in the first three terms:
0,0,0 A000004;
0,0,1 A000073;
0,1,0 A001590;
0,1,1 A000073 starting at a(1);
1,0,0 A000073 starting at a(-1);
1,0,1 A001590;
1,1,0 this sequence;
1,1,1 A000213.

Crossrefs

Programs

  • GAP
    a:=[1,1,0];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # G. C. Greubel, Apr 23 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-2*x^2)/(1-x-x^2-x^3) )); // G. C. Greubel, Apr 23 2019
    
  • Maple
    A081172 := proc(n)
        option remember;
        if n <= 2 then
            op(n+1,[1,1,0]) ;
        else
            add(procname(n-i),i=1..3) ;
        end if;
    end proc: # R. J. Mathar, Aug 09 2012
  • Mathematica
    LinearRecurrence[{1,1,1}, {1,1,0}, 40] (* Vladimir Joseph Stephan Orlovsky, Jun 07 2011 *)
  • PARI
    { a1=1; a2=1; a3=0; write("b081172.txt",0," ",a1); write("b081172.txt",1," ",a2); write("b081172.txt",2," ",a3); for(n=3,500, a=a1+a2+a3; a1=a2; a2=a3; a3=a; write("b081172.txt",n," ",a) ) } \\ Harry J. Smith, Mar 20 2009
    
  • PARI
    my(x='x+O('x^40)); Vec((1-2*x^2)/(1-x-x^2-x^3)) \\ G. C. Greubel, Apr 23 2019
    
  • Sage
    ((1-2*x^2)/(1-x-x^2-x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Apr 23 2019
    

Formula

From R. J. Mathar, Mar 27 2009: (Start)
G.f.: (1-2*x^2)/(1 - x - x^2 - x^3).
a(n) = A000073(n+2) - 2*A000073(n). (End)