[go: up one dir, main page]

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

%I #41 Jul 25 2024 22:06:25

%S 1,1,0,2,3,5,10,18,33,61,112,206,379,697,1282,2358,4337,7977,14672,

%T 26986,49635,91293,167914,308842,568049,1044805,1921696,3534550,

%U 6501051,11957297,21992898,40451246,74401441,136845585,251698272,462945298,851489155

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

%C 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

%C Completes the set of tribonacci numbers starting with 0's and 1's in the first three terms:

%C 0,0,0 A000004;

%C 0,0,1 A000073;

%C 0,1,0 A001590;

%C 0,1,1 A000073 starting at a(1);

%C 1,0,0 A000073 starting at a(-1);

%C 1,0,1 A001590;

%C 1,1,0 this sequence;

%C 1,1,1 A000213.

%H Harry J. Smith, <a href="/A081172/b081172.txt">Table of n, a(n) for n = 0..500</a>

%H Martin Burtscher, Igor Szczyrba, RafaƂ Szczyrba, <a href="https://www.emis.de/journals/JIS/VOL18/Szczyrba/sz3.html">Analytic Representations of the n-anacci Constants and Generalizations Thereof</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.5.

%H N. G. Voll, <a href="https://www.fq.math.ca/Papers1/51-3/Voll4-TermRecurrence.pdf">Some identities for four term recurrence relations</a>, Fib. Quart., 51 (2013), 268-273.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1).

%F From _R. J. Mathar_, Mar 27 2009: (Start)

%F G.f.: (1-2*x^2)/(1 - x - x^2 - x^3).

%F a(n) = A000073(n+2) - 2*A000073(n). (End)

%p A081172 := proc(n)

%p option remember;

%p if n <= 2 then

%p op(n+1,[1,1,0]) ;

%p else

%p add(procname(n-i),i=1..3) ;

%p end if;

%p end proc: # _R. J. Mathar_, Aug 09 2012

%t LinearRecurrence[{1,1,1}, {1,1,0}, 40] (* _Vladimir Joseph Stephan Orlovsky_, Jun 07 2011 *)

%o (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

%o (PARI) my(x='x+O('x^40)); Vec((1-2*x^2)/(1-x-x^2-x^3)) \\ _G. C. Greubel_, Apr 23 2019

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-2*x^2)/(1-x-x^2-x^3) )); // _G. C. Greubel_, Apr 23 2019

%o (Sage) ((1-2*x^2)/(1-x-x^2-x^3)).series(x, 40).coefficients(x, sparse=False) # _G. C. Greubel_, Apr 23 2019

%o (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

%Y Cf. A000004, A000073, A000213, A001590, A020992.

%K nonn,easy

%O 0,4

%A _Harry J. Smith_, Apr 19 2003