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.

Showing 1-10 of 36 results. Next

A214752 Primes in the sequence of tribonacci numbers starting 1, 1, 0 (A081172).

Original entry on oeis.org

2, 3, 5, 61, 379, 4337, 568049, 74401441, 135641613564613015742379733, 1265128384429601209773279760867, 17454716892349876427463772074092822077069402994829708101921142701
Offset: 1

Views

Author

Andrew Jiang, Aug 02 2012

Keywords

Comments

Sequence A081172 shows the tribonacci numbers that begin with 1, 1, 0.

Crossrefs

Cf. A081172.

A235396 Indices of primes in the tribonacci-like sequence, A081172.

Original entry on oeis.org

3, 4, 5, 9, 12, 16, 24, 32, 101, 116, 245, 34553, 52517, 99245, 140197
Offset: 1

Views

Author

Robert Price, Jan 09 2014

Keywords

Comments

a(16) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={1, 1, 0}; For[n=3, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[3]]=sum]

A000073 Tribonacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3) for n >= 3 with a(0) = a(1) = 0 and a(2) = 1.

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, 149, 274, 504, 927, 1705, 3136, 5768, 10609, 19513, 35890, 66012, 121415, 223317, 410744, 755476, 1389537, 2555757, 4700770, 8646064, 15902591, 29249425, 53798080, 98950096, 181997601, 334745777, 615693474, 1132436852
Offset: 0

Views

Author

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
Also (for n > 1) number of ordered trees with n+1 edges and having all leaves at level three. Example: a(4)=2 because we have two ordered trees with 5 edges and having all leaves at level three: (i) one edge emanating from the root, at the end of which two paths of length two are hanging and (ii) one path of length two emanating from the root, at the end of which three edges are hanging. - Emeric Deutsch, Jan 03 2004
a(n) is the number of compositions of n-2 with no part greater than 3. Example: a(5)=4 because we have 1+1+1 = 1+2 = 2+1 = 3. - Emeric Deutsch, Mar 10 2004
Let A denote the 3 X 3 matrix [0,0,1;1,1,1;0,1,0]. a(n) corresponds to both the (1,2) and (3,1) entries in A^n. - Paul Barry, Oct 15 2004
Number of permutations satisfying -k <= p(i)-i <= r, i=1..n-2, with k=1, r=2. - Vladimir Baltic, Jan 17 2005
Number of binary sequences of length n-3 that have no three consecutive 0's. Example: a(7)=13 because among the 16 binary sequences of length 4 only 0000, 0001 and 1000 have 3 consecutive 0's. - Emeric Deutsch, Apr 27 2006
Therefore, the complementary sequence to A050231 (n coin tosses with a run of three heads). a(n) = 2^(n-3) - A050231(n-3) - Toby Gottfried, Nov 21 2010
Convolved with the Padovan sequence = row sums of triangle A153462. - Gary W. Adamson, Dec 27 2008
For n > 1: row sums of the triangle in A157897. - Reinhard Zumkeller, Jun 25 2009
a(n+2) is the top left entry of the n-th power of any of the 3 X 3 matrices [1, 1, 1; 0, 0, 1; 1, 0, 0] or [1, 1, 0; 1, 0, 1; 1, 0, 0] or [1, 1, 1; 1, 0, 0; 0, 1, 0] or [1, 0, 1; 1, 0, 0; 1, 1, 0]. - R. J. Mathar, Feb 03 2014
a(n-1) is the top left entry of the n-th power of any of the 3 X 3 matrices [0, 0, 1; 1, 1, 1; 0, 1, 0], [0, 1, 0; 0, 1, 1; 1, 1, 0], [0, 0, 1; 1, 0, 1; 0, 1, 1] or [0, 1, 0; 0, 0, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
Also row sums of A082601 and of A082870. - Reinhard Zumkeller, Apr 13 2014
Least significant bits are given in A021913 (a(n) mod 2 = A021913(n)). - Andres Cicuttin, Apr 04 2016
The nonnegative powers of the tribonacci constant t = A058265 are t^n = a(n)*t^2 + (a(n-1) + a(n-2))*t + a(n-1)*1, for n >= 0, with a(-1) = 1 and a(-2) = -1. This follows from the recurrences derived from t^3 = t^2 + t + 1. See the example in A058265 for the first nonnegative powers. For the negative powers see A319200. - Wolfdieter Lang, Oct 23 2018
The term "tribonacci number" was coined by Mark Feinberg (1963), a 14-year-old student in the 9th grade of the Susquehanna Township Junior High School in Pennsylvania. He died in 1967 in a motorcycle accident. - Amiram Eldar, Apr 16 2021
Andrews, Just, and Simay (2021, 2022) remark that it has been suggested that this sequence is mentioned in Charles Darwin's Origin of Species as bearing the same relation to elephant populations as the Fibonacci numbers do to rabbit populations. - N. J. A. Sloane, Jul 12 2022

Examples

			G.f. = x^2 + x^3 + 2*x^4 + 4*x^5 + 7*x^6 + 13*x^7 + 24*x^8 + 44*x^9 + 81*x^10 + ...
		

References

  • M. Agronomof, Sur une suite récurrente, Mathesis (Series 4), Vol. 4 (1914), pp. 125-126.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 47, ex. 4.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.2.2.
  • Silvia Heubach and Toufik Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.
  • J. Riordan, An Introduction to Combinatorial Analysis, Princeton University Press, Princeton, NJ, 1978.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000045, A000078, A000213, A000931, A001590 (first differences, also a(n)+a(n+1)), A001644, A008288 (tribonacci triangle), A008937 (partial sums), A021913, A027024, A027083, A027084, A046738 (Pisano periods), A050231, A054668, A062544, A063401, A077902, A081172, A089068, A118390, A145027, A153462, A230216.
A057597 is this sequence run backwards: A057597(n) = a(1-n).
Row 3 of arrays A048887 and A092921 (k-generalized Fibonacci numbers).
Partitions: A240844 and A117546.
Cf. also A092836 (subsequence of primes), A299399 = A092835 + 1 (indices of primes).

Programs

  • GAP
    a:=[0,0,1];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # Muniru A Asiru, Oct 24 2018
  • Haskell
    a000073 n = a000073_list !! n
    a000073_list = 0 : 0 : 1 : zipWith (+) a000073_list (tail
                              (zipWith (+) a000073_list $ tail a000073_list))
    -- Reinhard Zumkeller, Dec 12 2011
    
  • Magma
    [n le 3 select Floor(n/3) else Self(n-1)+Self(n-2)+Self(n-3): n in [1..70]]; // Vincenzo Librandi, Jan 29 2016
    
  • Maple
    a:= n-> (<<0|1|0>, <0|0|1>, <1|1|1>>^n)[1,3]:
    seq(a(n), n=0..40);  # Alois P. Heinz, Dec 19 2016
    # second Maple program:
    A000073:=proc(n) option remember; if n <= 1 then 0 elif n=2 then 1 else procname(n-1)+procname(n-2)+procname(n-3); fi; end; # N. J. A. Sloane, Aug 06 2018
  • Mathematica
    CoefficientList[Series[x^2/(1 - x - x^2 - x^3), {x, 0, 50}], x]
    a[0] = a[1] = 0; a[2] = 1; a[n_] := a[n] = a[n - 1] + a[n - 2] + a[n - 3]; Array[a, 36, 0] (* Robert G. Wilson v, Nov 07 2010 *)
    LinearRecurrence[{1, 1, 1}, {0, 0, 1}, 60] (* Vladimir Joseph Stephan Orlovsky, May 24 2011 *)
    a[n_] := SeriesCoefficient[If[ n < 0, x/(1 + x + x^2 - x^3), x^2/(1 - x - x^2 - x^3)], {x, 0, Abs @ n}] (* Michael Somos, Jun 01 2013 *)
    Table[-RootSum[-1 - # - #^2 + #^3 &, -#^n - 9 #^(n + 1) + 4 #^(n + 2) &]/22, {n, 0, 20}] (* Eric W. Weisstein, Nov 09 2017 *)
  • Maxima
    A000073[0]:0$
    A000073[1]:0$
    A000073[2]:1$
    A000073[n]:=A000073[n-1]+A000073[n-2]+A000073[n-3]$
      makelist(A000073[n], n, 0, 40);  /* Emanuele Munarini, Mar 01 2011 */
    
  • PARI
    {a(n) = polcoeff( if( n<0, x / ( 1 + x + x^2 - x^3), x^2 / ( 1 - x - x^2 - x^3) ) + x * O(x^abs(n)), abs(n))}; /* Michael Somos, Sep 03 2007 */
    
  • PARI
    my(x='x+O('x^99)); concat([0, 0], Vec(x^2/(1-x-x^2-x^3))) \\ Altug Alkan, Apr 04 2016
    
  • PARI
    a(n)=([0,1,0;0,0,1;1,1,1]^n)[1,3] \\ Charles R Greathouse IV, Apr 18 2016, simplified by M. F. Hasler, Apr 18 2018
    
  • Python
    def a(n, adict={0:0, 1:0, 2:1}):
        if n in adict:
            return adict[n]
        adict[n]=a(n-1)+a(n-2)+a(n-3)
        return adict[n] # David Nacin, Mar 07 2012
    from functools import cache
    @cache
    def A000073(n: int) -> int:
        if n <= 1: return 0
        if n == 2: return 1
        return A000073(n-1) + A000073(n-2) + A000073(n-3) # Peter Luschny, Nov 21 2022
    

Formula

G.f.: x^2/(1 - x - x^2 - x^3).
G.f.: x^2 / (1 - x / (1 - x / (1 + x^2 / (1 + x)))). - Michael Somos, May 12 2012
G.f.: Sum_{n >= 0} x^(n+2) *[ Product_{k = 1..n} (k + k*x + x^2)/(1 + k*x + k*x^2) ] = x^2 + x^3 + 2*x^4 + 4*x^5 + 7*x^6 + 13*x^7 + ... may be proved by the method of telescoping sums. - Peter Bala, Jan 04 2015
a(n+1)/a(n) -> A058265. a(n-1)/a(n) -> A192918.
a(n) = central term in M^n * [1 0 0] where M = the 3 X 3 matrix [0 1 0 / 0 0 1 / 1 1 1]. (M^n * [1 0 0] = [a(n-1) a(n) a(n+1)].) a(n)/a(n-1) tends to the tribonacci constant, 1.839286755... = A058265, an eigenvalue of M and a root of x^3 - x^2 - x - 1 = 0. - Gary W. Adamson, Dec 17 2004
a(n+2) = Sum_{k=0..n} T(n-k, k), where T(n, k) = trinomial coefficients (A027907). - Paul Barry, Feb 15 2005
A001590(n) = a(n+1) - a(n); A001590(n) = a(n-1) + a(n-2) for n > 1; a(n) = (A000213(n+1) - A000213(n))/2; A000213(n-1) = a(n+2) - a(n) for n > 0. - Reinhard Zumkeller, May 22 2006
Let C = the tribonacci constant, 1.83928675...; then C^n = a(n)*(1/C) + a(n+1)*(1/C + 1/C^2) + a(n+2)*(1/C + 1/C^2 + 1/C^3). Example: C^4 = 11.444...= 2*(1/C) + 4*(1/C + 1/C^2) + 7*(1/C + 1/C^2 + 1/C^3). - Gary W. Adamson, Nov 05 2006
a(n) = j*C^n + k*r1^n + L*r2^n where C is the tribonacci constant (C = 1.8392867552...), real root of x^3-x^2-x-1=0, and r1 and r2 are the two other roots (which are complex), r1 = m+p*i and r2 = m-p*i, where i = sqrt(-1), m = (1-C)/2 (m = -0.4196433776...) and p = ((3*C-5)*(C+1)/4)^(1/2) = 0.6062907292..., and where j = 1/((C-m)^2 + p^2) = 0.1828035330..., k = a+b*i, and L = a-b*i, where a = -j/2 = -0.0914017665... and b = (C-m)/(2*p*((C-m)^2 + p^2)) = 0.3405465308... . - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 23 2007
a(n+1) = 3*c*((1/3)*(a+b+1))^n/(c^2-2*c+4) where a=(19+3*sqrt(33))^(1/3), b=(19-3*sqrt(33))^(1/3), c=(586+102*sqrt(33))^(1/3). Round to the nearest integer. - Al Hakanson (hawkuu(AT)gmail.com), Feb 02 2009
a(n) = round(3*((a+b+1)/3)^n/(a^2+b^2+4)) where a=(19+3*sqrt(33))^(1/3), b=(19-3*sqrt(33))^(1/3).. - Anton Nikonov
Another form of the g.f.: f(z) = (z^2-z^3)/(1-2*z+z^4). Then we obtain a(n) as a sum: a(n) = Sum_{i=0..floor((n-2)/4)} ((-1)^i*binomial(n-2-3*i,i)*2^(n-2-4*i)) - Sum_{i=0..floor((n-3)/4)} ((-1)^i*binomial(n-3-3*i,i)*2^(n-3-4*i)) with natural convention: Sum_{i=m..n} alpha(i) = 0 for m > n. - Richard Choulet, Feb 22 2010
a(n+2) = Sum_{k=0..n} Sum_{i=k..n, mod(4*k-i,3)=0} binomial(k,(4*k-i)/3)*(-1)^((i-k)/3)*binomial(n-i+k-1,k-1). - Vladimir Kruchinin, Aug 18 2010
a(n) = 2*a(n-2) + 2*a(n-3) + a(n-4). - Gary Detlefs, Sep 13 2010
Sum_{k=0..2*n} a(k+b)*A027907(n,k) = a(3*n+b), b >= 0 (see A099464, A074581).
a(n) = 2*a(n-1) - a(n-4), with a(0)=a(1)=0, a(2)=a(3)=1. - Vincenzo Librandi, Dec 20 2010
Starting (1, 2, 4, 7, ...) is the INVERT transform of (1, 1, 1, 0, 0, 0, ...). - Gary W. Adamson, May 13 2013
G.f.: Q(0)*x^2/2, where Q(k) = 1 + 1/(1 - x*(4*k+1 + x + x^2)/( x*(4*k+3 + x + x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 09 2013
a(n+2) = Sum_{j=0..floor(n/2)} Sum_{k=0..j} binomial(n-2*j,k)*binomial(j,k)*2^k. - Tony Foster III, Sep 08 2017
Sum_{k=0..n} (n-k)*a(k) = (a(n+2) + a(n+1) - n - 1)/2. See A062544. - Yichen Wang, Aug 20 2020
a(n) = A008937(n-1) - A008937(n-2) for n >= 2. - Peter Luschny, Aug 20 2020
From Yichen Wang, Aug 27 2020: (Start)
Sum_{k=0..n} a(k) = (a(n+2) + a(n) - 1)/2. See A008937.
Sum_{k=0..n} k*a(k) = ((n-1)*a(n+2) - a(n+1) + n*a(n) + 1)/2. See A337282. (End)
For n > 1, a(n) = b(n) where b(1) = 1 and then b(n) = Sum_{k=1..n-1} b(n-k)*A000931(k+2). - J. Conrad, Nov 24 2022
Conjecture: the congruence a(n*p^(k+1)) + a(n*p^k) + a(n*p^(k-1)) == 0 (mod p^k) holds for positive integers k and n and for all the primes p listed in A106282. - Peter Bala, Dec 28 2022
Sum_{k=0..n} k^2*a(k) = ((n^2-4*n+6)*a(n+1) - (2*n^2-2*n+5)*a(n) + (n^2-2*n+3)*a(n-1) - 3)/2. - Prabha Sivaramannair, Feb 10 2024
a(n) = Sum_{r root of x^3-x^2-x-1} r^n/(3*r^2-2*r-1). - Fabian Pereyra, Nov 23 2024

Extensions

Minor edits by M. F. Hasler, Apr 18 2018
Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021

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

Original entry on oeis.org

1, 1, 1, 3, 5, 9, 17, 31, 57, 105, 193, 355, 653, 1201, 2209, 4063, 7473, 13745, 25281, 46499, 85525, 157305, 289329, 532159, 978793, 1800281, 3311233, 6090307, 11201821, 20603361, 37895489, 69700671, 128199521, 235795681, 433695873, 797691075, 1467182629
Offset: 0

Views

Author

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
Number of (n-1)-bit binary sequences with each one adjacent to a zero. - R. H. Hardin, Dec 24 2007
The binomial transform is A099216. The inverse binomial transform is (-1)^n*A124395(n). - R. J. Mathar, Aug 19 2008
Equals INVERT transform of (1, 0, 2, 0, 2, 0, 2, ...). a(6) = 17 = (1, 1, 1, 3, 5, 9) dot (0, 2, 0, 2, 0, 1) = (0 + 2 + 0 + 6 + 0 + 9) = 17. - Gary W. Adamson, Apr 27 2009
From John M. Campbell, May 16 2011: (Start)
Equals the number of tilings of a 2 X n grid using singletons and "S-shaped tetrominoes" (i.e., shapes of the form Polygon[{{0, 0}, {2, 0}, {2, 1}, {3, 1}, {3, 2}, {1, 2}, {1, 1}, {0, 1}}]).
Also equals the number of tilings of a 2 X n grid using singletons and "T-shaped tetrominoes" (i.e., shapes of the form Polygon[{{0, 0}, {3, 0}, {3, 1}, {2, 1}, {2, 2}, {1, 2}, {1, 1}, {0, 1}}]). (End)
Pisano period lengths: 1, 1, 13, 4, 31, 13, 48, 8, 39, 31, 110, 52, 168, 48, 403, 16, 96, 39, 360, 124, ... (differs from A106293). - R. J. Mathar, Aug 10 2012
a(n) is the number of compositions of n with no consecutive 1's. a(4) = 5 because we have: 4, 3+1, 1+3, 2+2, 1+2+1. Cf. A239791, A003242. - Geoffrey Critzer, Mar 27 2014
a(n+2) is the number of words of length n over alphabet {1,2,3} without having {11,12,22,23} as substrings. - Ran Pan, Sep 16 2015
Satisfies Benford's law [see A186190]. - N. J. A. Sloane, Feb 09 2017
a(n) is also the number of dominating sets on the (n-1)-path graph. - Eric W. Weisstein, Mar 31 2017
a(n) is also the number of maximal irredundant sets and minimal dominating sets in the (2n-3)-triangular snake graph. - Eric W. Weisstein, Jun 09 2019
a(n) is also the number of anti-palindromic compositions of n, where a composition (c(1), c(2),..., c(k)) is anti-palindromic if c(i) is not equal to c(k+1-i) whenever 1 <= i <= k/2. For instance, there are a(4) = 5 anti-palindromic compositions of 4: 4, 31, 13, 211, 112. - Jia Huang, Apr 08 2023

Examples

			G.f. = 1 + x + x^2 + 3*x^3 + 5*x^4 + 9*x^5+ 17*x^6 + 31*x^7 + 57*x^8 + ...
		

References

  • Kenneth Edwards, Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    a:=[1,1,1];; for n in [4..45] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 09 2019
    
  • Haskell
    a000213 n = a000213_list !! n
    a000213_list = 1 : 1 : 1 : zipWith (+) a000213_list
       (tail $ zipWith (+) a000213_list (tail a000213_list))
    -- Reinhard Zumkeller, Apr 07 2012
    
  • Magma
    I:=[1,1,1]; [n le 3 select I[n] else Self(n-1) + Self(n-2) + Self(n-3): n in [1..45]]; // G. C. Greubel, Jun 09 2019
    
  • Maple
    K:=(1-z^2)/(1-z-z^2-z^3): Kser:=series(K, z=0, 45): seq((coeff(Kser, z, n)), n= 0..34); # Zerinvary Lajos, Nov 08 2007
    A000213:=(z-1)*(1+z)/(-1+z+z**2+z**3); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    LinearRecurrence[{1, 1, 1}, {1, 1, 1}, 45] (* Harvey P. Dale, May 23 2011 *)
    Table[RootSum[-1 - # - #^2 + #^3 &, 2 #^n - 4 #^(n + 1) + 3 #^(n + 2) &]/11, {n, 0, 45}] (* Eric W. Weisstein, Apr 10 2018 *)
    CoefficientList[Series[(1-x)(1+x)/(1-x-x^2-x^3), {x, 0, 45}], x] (* Eric W. Weisstein, Apr 10 2018 *)
  • Maxima
    a(n):=sum(sum(binomial(n-2*m+1,m-i)*binomial(n-2*m+i,n-2*m), i,0,m),m,0,(n)/2); /* Vladimir Kruchinin, Dec 17 2011 */
    
  • PARI
    a(n)=tn=[1,1,1;1,0,0;0,1,0]^n;tn[3,1]+tn[3,2]+tn[3,3] \\ Charles R Greathouse IV, Feb 18 2011
    
  • Python
    alst = [1, 1, 1]
    [alst.append(alst[n-1] + alst[n-2] + alst[n-3]) for n in range(3, 37)]
    print(alst) # Michael S. Branicky, Sep 21 2021
  • Sage
    ((1-x^2)/(1-x-x^2-x^3)).series(x, 45).coefficients(x, sparse=False) # G. C. Greubel, Jun 09 2019
    

Formula

G.f.: (1-x)*(1+x)/(1-x-x^2-x^3). - Ralf Stephan, Feb 11 2004
G.f.: 1 / (1 - x / (1 - 2*x^2 / (1 + x^2))). - Michael Somos, May 12 2012
a(n) = rightmost term of M^n * [1 1 1], where M is the 3 X 3 matrix [1 1 1 / 1 0 0 / 0 1 0]. M^n * [1 1 1] = [a(n+2) a(n+1) a(n)]. a(n)/a(n-1) tends to the tribonacci constant, 1.839286755...; an eigenvalue of M and a root of x^3 - x^2 - x - 1 = 0. - Gary W. Adamson, Dec 17 2004
a(n) = A001590(n+3) - A001590(n+2); a(n+1) - a(n) = 2*A000073(n); a(n) = A000073(n+3) - A000073(n+1). - Reinhard Zumkeller, May 22 2006
a(n) = A001590(n) + A001590(n+1). - Philippe Deléham, Sep 25 2006
a(n) ~ (F - 1) * T^n, where F = A086254 and T = A058265. - Charles R Greathouse IV, Nov 09 2008
a(n) = 2*a(n-1) - a(n-4), n > 3. - Gary Detlefs, Sep 13 2010
a(n) = Sum_{m=0..n/2} Sum_{i=0..m} binomial(n-2*m+1,m-i)*binomial(n-2*m+i, n-2*m). - Vladimir Kruchinin, Dec 17 2011
a(n) = 2*A008937(n-2) + 1 for n > 1. - Reinhard Zumkeller, Apr 07 2012
G.f.: 1+x/(U(0) - x) where U(k) = 1 - x^2/(1 - 1/(1 + 1/U(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 16 2012
G.f.: 1 + x + x^2/(G(0)-x) where G(k) = 1 - x*(2*k+1)/(1 - 1/(1 + (2*k+1)/G(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 17 2012
G.f.: (1+x)*(1-x)*(1 + x*(G(0)-1)/(x+1)) where G(k) = 1 + (1+x+x^2)/(1-x/(x+1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 26 2013
G.f.: 1/(1+x-G(0)), where G(k) = 1 - 1/(1 - x/(x - 1/(1 + 1/(1 - x/(x + 1/G(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, Jun 20 2013
a(n) = (-1)^n * A180735(-1-n) for all n in Z. - Michael Somos, Aug 15 2015
a(n) = Sum_{r root of x^3-x^2-x-1} r^n/(-r^2+2*r+2). - Fabian Pereyra, Nov 21 2024

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

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 6, 11, 20, 37, 68, 125, 230, 423, 778, 1431, 2632, 4841, 8904, 16377, 30122, 55403, 101902, 187427, 344732, 634061, 1166220, 2145013, 3945294, 7256527, 13346834, 24548655, 45152016, 83047505, 152748176, 280947697, 516743378, 950439251
Offset: 0

Views

Author

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
Dimensions of the homogeneous components of the higher order peak algebra associated to cubic roots of unity (Hilbert series = 1 + 1*t + 2*t^2 + 3*t^3 + 6*t^4 + 11*t^5 ...). - Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Oct 22 2006
Starting with offset 3: (1, 2, 3, 6, 11, 10, 37, ...) = row sums of triangle A145579. - Gary W. Adamson, Oct 13 2008
Starting (1, 2, 3, 6, 11, ...) = INVERT transform of the periodic sequence (1, 1, 0, 1, 1, 0, 1, 1, 0, ...). - Gary W. Adamson, May 04 2009
The comment of May 04 2009 is equivalent to: The numbers of ordered compositions of n using integers that are not multiples of 3 is equal to a(n+2) for n>=1, see [Hoggatt-Bicknell (1975) eq (2.7)]. - Gary W. Adamson, May 13 2013
Primes in the sequence are 2, 3, 11, 37, 634061, 7256527, ... in A231574. - R. J. Mathar, Aug 09 2012
Pisano period lengths: 1, 2, 13, 8, 31, 26, 48, 16, 39, 62,110,104,168, 48,403, 32, 96, 78, 360, 248, ... . - R. J. Mathar, Aug 10 2012
a(n+1) is the top left entry of the n-th power of any of 3 X 3 matrices [0, 1, 0; 1, 1, 1; 1, 0, 0], [0, 1, 1; 1, 1, 0; 0, 1, 0], [0, 1, 1; 0, 0, 1; 1, 0, 1] or [0, 0, 1; 1, 0, 0; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
a(n+3) equals the number of n-length binary words avoiding runs of zeros of lengths 3i+2, (i=0,1,2,...). - Milan Janjic, Feb 26 2015
Sums of pairs of successive terms of A000073. - N. J. A. Sloane, Oct 30 2016
The power Q^n, for n >= 0, of the tribonacci Q-matrix Q = matrix([1, 1, 1], [1, 0, 0], [0, 1, 0]) is, by the Cayley-Hamilton theorem, Q^n = matrix([a(n+2), a(n+1) + a(n), a(n+1)], [a(n+1), a(n) + a(n-1), a(n)], [a(n), a(n-1) + a(n-2), a(n-1)]), with a(-2) = -1 and a(-1) = 1. One can use a(n) = a(n-1) + a(n-2) + a(n-3) in order to obtain a(-1) and a(-2). - Wolfdieter Lang, Aug 13 2018
a(n+2) is the number of entries n, for n>=1, in the sequence {A278038(k)}A278038(0)%20=%201).%20-%20_Wolfdieter%20Lang">{k>=1} (without A278038(0) = 1). - _Wolfdieter Lang, Sep 11 2018
In terms of the tribonacci numbers T(n) = A000073(n) the nonnegative powers of the Q-matrix (from the Aug 13 2018 comment) are Q^n = T(n)*Q^2 + (T(n-1) + T(n-2))*Q + T(n-1)*1_3, for n >= 0, with T(-1) = 1, T(-2) = -1. This is equivalent to the powers t^n of the tribonacci constant t = A058255 (or also for powers of the complex solutions). - Wolfdieter Lang, Oct 24 2018

Examples

			a(12)=a(11)+a(10)+a(9): 230=125+68+37.
For n=5 the partitions of 5 are 1+1+1+1+1 (1 composition), 1+1+1+2 (4 compositions), 1+2+2 (3 compositions), 1+1+3 (not contrib because 3 is a part), 2+3 (no contrib because 3 is a part), 1+4 (2 compositions) and 5 (1 composition), total 1+4+3+2+1=11 =a(5+2) - _R. J. Mathar_, Jan 13 2023
		

References

  • Kenneth Edwards and Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    a:=[0,1,0];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # Muniru A Asiru, Oct 24 2018
  • Magma
    I:=[0,1,0]; [n le 3 select I[n]  else Self(n-1)+Self(n-2)+Self(n-3): n in [1..40]]; // Vincenzo Librandi, Apr 19 2018
    
  • Maple
    seq(coeff(series(x*(1-x)/(1-x-x^2-x^3),x,n+1), x, n), n = 0 .. 40); # Muniru A Asiru, Oct 24 2018
    # alternative
    A001590 := proc(n)
        option remember;
        if n <=2 then
            op(n+1,[0,1,0]) ;
        else
            procname(n-1)+procname(n-2)+procname(n-3) ;
        end if;
    end proc:
    seq(A001590(n),n=0..30) ;# R. J. Mathar, Nov 22 2024
  • Mathematica
    LinearRecurrence[{1,1,1}, {0,1,0}, 50] (* Vladimir Joseph Stephan Orlovsky, Jan 28 2012 *)
    RecurrenceTable[{a[0]==0, a[1]==1, a[2]==0, a[n]==a[n-1]+a[n-2]+a[n-3]}, a, {n, 40}] (* Vincenzo Librandi, Apr 19 2018 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 1,1,1]^n*[0;1;0])[1,1] \\ Charles R Greathouse IV, Jul 28 2015
    
  • Sage
    def A001590():
        W = [0, 1, 0]
        while True:
            yield W[0]
            W.append(sum(W))
            W.pop(0)
    a = A001590(); [next(a) for  in range(38)]  # _Peter Luschny, Sep 12 2016
    

Formula

G.f.: x*(1-x)/(1-x-x^2-x^3).
Limit a(n)/a(n-1) = t where t is the real solution of t^3 = 1 + t + t^2, t = A058265 = 1.839286755... . If T(n) = A000073(n) then t^n = T(n-1) + a(n)*t + T(n)*t^2, for n >= 0, with T(-1) = 1.
a(3*n) = Sum_{k+l+m=n} (n!/k!l!m!)*a(l+2*m). Example: a(12)=a(8)+4a(7)+10a(6)+16a(5)+19a(4)+16a(3)+10a(2)+4a(1)+a(0) The coefficients are the trinomial coefficients. T(n) and T(n-1) also satisfy this equation. (T(-1)=1)
From Reinhard Zumkeller, May 22 2006: (Start)
a(n) = A000073(n+1)-A000073(n);
a(n) = A000073(n-1)+A000073(n-2) for n>1;
A000213(n-2) = a(n+1)-a(n) for n>1. (End)
a(n) + a(n+1) = A000213(n). - Philippe Deléham, Sep 25 2006
If p[1]=0, p[i]=2, (i>1), and if A is Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n+1)=det A. - Milan Janjic, May 02 2010
For n>=4, a(n)=2*a(n-1)-a(n-4). - Bob Selcoe, Feb 18 2014
a(-1-n) = -A078046(n). - Michael Somos, Jun 01 2014
a(n) = Sum_{r root of x^3-x^2-x-1} r^n/(3*r+1). - Fabian Pereyra, Nov 22 2024

Extensions

Additional comments from Miklos Kristof, Jul 03 2002

A235862 Indices of primes in A141523.

Original entry on oeis.org

0, 3, 4, 5, 8, 10, 14, 16, 24, 30, 40, 54, 63, 66, 67, 109, 188, 203, 421, 463, 704, 730, 798, 1155, 1259, 1376, 1789, 2095, 2650, 3833, 4538, 4794, 4840, 5386, 8348, 15176, 17282, 21250, 21386, 21825, 31242, 32843, 33706, 37026, 47546, 66848
Offset: 1

Views

Author

Robert Price, Jan 16 2014

Keywords

Comments

a(47) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={3,1,1}; Print[0]; For[n=3, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[3]]=sum]

Extensions

Name clarified by Arthur O'Dwyer, Jul 25 2024

A136175 Tribonacci array, T(n,k).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 11, 9, 8, 13, 20, 17, 15, 10, 24, 37, 31, 28, 19, 12, 44, 68, 57, 51, 35, 22, 14, 81, 125, 105, 94, 64, 41, 26, 16, 149, 230, 193, 173, 118, 75, 48, 30, 18, 274, 423, 355, 318, 217, 138, 88, 55, 33, 21, 504, 778, 653, 585, 399, 254, 162, 101, 61, 39, 23
Offset: 1

Views

Author

Clark Kimberling, Dec 18 2007

Keywords

Comments

As an interspersion (and dispersion), the array is, as a sequence, a permutation of the positive integers. Column k consists of the numbers m such that the least summand in the tribonacci representation of m is T(1,k). For example, column 1 consists of numbers with least summand 1. This array arises from tribonacci representations in much the same way that the Wythoff array, A035513, arises from Fibonacci (or Zeckendorf) representations.
From Abel Amene, Jul 29 2012: (Start)
(Row 1) = A000073 (offset=4) a(0)=0, a(1)=0, a(2)=1
(Row 2) = A001590 (offset=5) a(0)=0, a(1)=1, a(2)=0
(Row 3) = A000213 (offset=4) a(0)=1, a(1)=1, a(2)=1
(Row 4) = A214899 (offset=5) a(0)=2, a(1)=1, a(2)=2
(Row 5) = A020992 (offset=6) a(0)=0, a(1)=2, a(2)=1
(Row 6) = A100683 (offset=6) a(0)=-1,a(1)=2, a(2)=2
(Row 7) = A135491 (offset=4) a(0)=2, a(1)=4, a(2)=8
(Row 8) = A214727 (offset=6) a(0)=1, a(1)=1, a(2)=2
(Row 9) = A081172 (offset=8) a(0)=1, a(1)=1, a(2)=0
(column 1) = A003265
(column 2) = A353083
(End) [Corrected and extended by John Keith, May 09 2022]

Examples

			Northwest corner:
1  2   4   7   13  24   44   81  149 274 504
3  6   11  20  37  68   125  230 423 778
5  9   17  31  57  105  193  355 653
8  15  28  51  94  173  318  585
10 19  35  64  118 217  399
12 22  41  75  138 254
14 26  48  88  162
16 30  55 101
18 33  61
21 39
23
		

Crossrefs

Programs

  • Maple
    # maximum index in A73 such that A73 <= n.
    A73floorIdx := proc(n)
        local k ;
        for k from 3 do
            if A000073(k) = n then
                return k ;
            elif A000073(k) > n then
                return k -1 ;
            end if ;
        end do:
    end proc:
    # tribonacci expansion coeffs of n
    A278038 := proc(n)
        local k,L,nres ;
        k := A73floorIdx(n) ;
        L := [1] ;
        nres := n-A000073(k) ;
        while k >= 4 do
            k := k-1 ;
            if nres >= A000073(k) then
                L := [1,op(L)] ;
                nres := nres-A000073(k) ;
            else
                L := [0,op(L)] ;
            end if ;
        end do:
        return L ;
    end proc:
    A278038inv := proc(L)
        add( A000073(i+2)*op(i,L),i=1..nops(L)) ;
    end proc:
    A135175 := proc(n,k)
        option remember ;
        local a,known,prev,nprev,kprev,freb ;
        if n =1 then
            A000073(k+2) ;
        elif k>3 then
            procname(n,k-1)+procname(n,k-2)+procname(n,k-3) ;
        else
            if k = 1 then
                for a from 1 do
                    known := false ;
                    for nprev from 1 to n-1 do
                        for kprev from 1 do
                            if procname(nprev,kprev) > a then
                                break ;
                            elif procname(nprev,kprev) = a then
                                known := true ;
                            end if;
                        end do:
                    end do:
                    if not known then
                        return a ;
                    end if;
                end do:
            else
                prev := procname(n,k-1) ;
                freb := A278038(prev) ;
                return A278038inv([0,op(freb)]) ;
            end if;
        end if;
    end proc:
    seq(seq(A135175(n,d-n),n=1..d-1),d=2..12) ; # R. J. Mathar, Jun 07 2022

Formula

T(1,1)=1, T(1,2)=2, T(1,3)=4, T(1,k)=T(1,k-1)+T(1,k-2)+T(1,k-3) for k>3. Row 1 is the tribonacci basis; write B(k)=T(1,k). Each row satisfies the recurrence T(n,k)=T(n,k-1)+T(n,k-2)+T(n,k-3). T(n,1) is least number not in an earlier row. If T(n,1) has tribonacci representation B(k(1))+B(k(2))+...+B(k(m)), then T(n,2) = B(k(2))+B(k(3))+...+B(k(m+1)) and T(n,3) = B(k(3))+B(k(4))+...+B(k(m+2)). (Continued shifting of indices gives the other terms in row n, also.)

Extensions

T(3, 4) corrected and more terms by John Keith, May 09 2022

A247027 Indices of primes in the tetranacci sequence A001631.

Original entry on oeis.org

5, 7, 12, 19, 47, 97, 124, 244, 564, 1037, 12007, 13662, 180039
Offset: 1

Views

Author

Robert Price, Sep 09 2014

Keywords

Comments

a(14) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={0,0,1,0}; For[n=4, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[4]]=sum]

A241660 Indices of primes in A001630.

Original entry on oeis.org

3, 4, 7, 19, 62, 94, 722, 5197, 5262, 6182, 14007, 21579, 35354, 75592
Offset: 1

Views

Author

Robert Price, Apr 26 2014

Keywords

Comments

a(15) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={0,0,1,2}; Print[3]; For[n=4, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[4]]=sum]

Extensions

Prepended a(1)=3 and Mathematica program corrected by Robert Price, Sep 09 2014

A243622 Indices of primes in A214829.

Original entry on oeis.org

1, 2, 4, 10, 11, 12, 13, 58, 63, 89, 132, 157, 426, 457, 506, 613, 1839, 1936, 2042, 2355, 3178, 3782, 8556, 8688, 22152, 23232, 44074, 71770, 222666
Offset: 1

Views

Author

Robert Price, Jun 07 2014

Keywords

Comments

a(30) > 222666.

Crossrefs

Programs

  • Mathematica
    a={1,7,7}; Print["1"]; Print["2"]; For[n=3, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[3]]=sum]

Extensions

a(27) corrected by Robert Price, May 22 2019
a(29) from Robert Price, May 23 2019
Showing 1-10 of 36 results. Next