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-8 of 8 results.

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

A008937 a(n) = Sum_{k=0..n} T(k) where T(n) are the tribonacci numbers A000073.

Original entry on oeis.org

0, 1, 2, 4, 8, 15, 28, 52, 96, 177, 326, 600, 1104, 2031, 3736, 6872, 12640, 23249, 42762, 78652, 144664, 266079, 489396, 900140, 1655616, 3045153, 5600910, 10301680, 18947744, 34850335, 64099760, 117897840, 216847936, 398845537, 733591314, 1349284788
Offset: 0

Views

Author

N. J. A. Sloane, Alejandro Teruel (teruel(AT)usb.ve)

Keywords

Comments

a(n+1) is the number of n-bit sequences that avoid 1100. - David Callan, Jul 19 2004 [corrected by Kent E. Morrison, Jan 08 2019]. Also the number of n-bit sequences avoiding one of the patterns 1000, 0011, 1110, ... or any binary string of length 4 without overlap at beginning and end. Strings where it is not true are: 1111, 1010, 1001, ... and their bitwise complements. - Alois P. Heinz, Jan 09 2019
Row sums of Riordan array (1/(1-x), x(1+x+x^2)). - Paul Barry, Feb 16 2005
Diagonal sums of Riordan array (1/(1-x)^2, x(1+x)/(1-x)), A104698.
A shifted version of this sequence can be found in Eqs. (4) and (3) on p. 356 of Dunkel (1925) with r = 3. (Equation (3) follows equation (4) in the paper!) The whole paper is a study of the properties of this and other similar sequences indexed by the parameter r. For r = 2, we get a shifted version of A000071. For r = 4, we get a shifted version of A107066. For r = 5, we get a shifted version of A001949. For r = 6, we get a shifted version of A172316. See also the table in A172119. - Petros Hadjicostas, Jun 14 2019
Officially, to match A000073, this should start with a(0)=a(1)=0, a(2)=1. - N. J. A. Sloane, Sep 12 2020
Numbers with tribonacci representation that is a prefix of 100100100100... . - Jeffrey Shallit, Jul 10 2024

Examples

			G.f. = x + 2*x^2 + 4*x^3 + 8*x^4 + 15*x^5 + 28*x^6 + 52*x^7 + 96*x^8 + 177*x^9 + ... [edited by _Petros Hadjicostas_, Jun 12 2019]
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 41.

Crossrefs

Partial sums of A000073. Cf. A000213, A018921, A027084, A077908, A209972.
Row sums of A055216.
Column k = 1 of A140997 and second main diagonal of A140994.

Programs

  • GAP
    a:=[0,1,1];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # G. C. Greubel, Sep 13 2019
  • Haskell
    a008937 n = a008937_list !! n
    a008937_list = tail $ scanl1 (+) a000073_list
    -- Reinhard Zumkeller, Apr 07 2012
    
  • Magma
    [ n eq 1 select 0 else n eq 2 select 1 else n eq 3 select 2 else n eq 4 select 4 else 2*Self(n-1)-Self(n-4): n in [1..40] ]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A008937 := proc(n) option remember; if n <= 3 then 2^n else 2*procname(n-1)-procname(n-4) fi; end;
    a:= n-> (Matrix([[1,1,0,0], [1,0,1,0], [1,0,0,0], [1,0,0,1]])^n)[4,1]: seq(a(n), n=0..50); # Alois P. Heinz, Jul 24 2008
  • Mathematica
    CoefficientList[Series[x/(1-2x+x^4), {x, 0, 40}], x]
    Accumulate[LinearRecurrence[{1,1,1},{0,1,1},40]] (* Harvey P. Dale, Dec 04 2017 *)
    LinearRecurrence[{2, 0, 0, -1},{0, 1, 2, 4},40] (* Ray Chandler, Mar 01 2024 *)
  • PARI
    {a(n) = if( n<0, polcoeff( - x^3 / (1 - 2*x^3 + x^4) + x * O(x^-n), -n), polcoeff( x / (1 - 2*x + x^4) + x * O(x^n), n))}; /* Michael Somos, Aug 23 2014 */
    
  • PARI
    a(n) = sum(j=0, n\2, sum(k=0, j, binomial(n-2*j,k+1)*binomial(j,k)*2^k)); \\ Michel Marcus, Sep 08 2017
    
  • SageMath
    def A008937_list(prec):
        P = PowerSeriesRing(ZZ, 'x', prec)
        x = P.gen().O(prec)
        return (x/(1-2*x+x^4)).list()
    A008937_list(40) # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = A018921(n-2) = A027084(n+1) + 1.
a(n) = (A000073(n+2) + A000073(n+4) - 1)/2.
From Mario Catalani (mario.catalani(AT)unito.it), Aug 09 2002: (Start)
G.f.: x/((1-x)*(1-x-x^2-x^3)).
a(n) = 2*a(n-1) - a(n-4), a(0) = 0, a(1) = 1, a(2) = 2, a(3) = 4. (End)
a(n) = 1 + a(n-1) + a(n-2) + a(n-3). E.g., a(11) = 1 + 600 + 326 + 177 = 1104. - Philippe LALLOUET (philip.lallouet(AT)orange.fr), Oct 29 2007
a(n) = term (4,1) in the 4 X 4 matrix [1,1,0,0; 1,0,1,0; 1,0,0,0; 1,0,0,1]^n. - Alois P. Heinz, Jul 24 2008
a(n) = -A077908(-n-3). - Alois P. Heinz, Jul 24 2008
a(n) = (A000213(n+2) - 1) / 2. - Reinhard Zumkeller, Apr 07 2012
a(n) = Sum_{j=0..floor(n/2)} Sum_{k=0..j} binomial(n-2j,k+1) *binomial(j,k)*2^k. - Tony Foster III, Sep 08 2017
a(n) = Sum_{k=0..floor(n/2)} (n-2*k)*hypergeom([-k,-n+2*k+1], [2], 2). - Peter Luschny, Nov 09 2017
a(n) = 2^(n-1)*hypergeom([1-n/4, 1/4-n/4, 3/4-n/4, 1/2-n/4], [1-n/3, 1/3-n/3, 2/3-n/3], 16/27) for n > 0. - Peter Luschny, Aug 20 2020
a(n-1) = T(n) + T(n-3) + T(n-6) + ... + T(2+((n-2) mod 3)), for n >= 4, where T is A000073(n+1). - Jeffrey Shallit, Dec 24 2020

A352105 Numbers whose maximal tribonacci representation (A352103) is palindromic.

Original entry on oeis.org

0, 1, 3, 5, 7, 8, 14, 18, 23, 27, 36, 40, 51, 52, 62, 69, 78, 88, 95, 102, 110, 130, 148, 156, 176, 181, 194, 211, 229, 242, 246, 264, 277, 294, 312, 325, 326, 363, 397, 411, 448, 463, 477, 514, 548, 562, 599, 617, 650, 674, 682, 715, 739, 770, 803, 827, 838, 862
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2022

Keywords

Comments

A027084(n) is a term since its maximal tribonacci representation is n-1 1's and no 0's.
The pairs {A008937(3*k+1)-1, A008937(3*k+1)} = {0, 1}, {7, 8}, {51, 52}, ... are consecutive terms in this sequence: the maximal tribonacci representation of A008937(3*k+1)-1 is 3*k 1's and no 0's (except for k=0 where the representation is 0), and the maximal tribonacci representation of A008937(3*k+1) is of the form 100100...1001 with k blocks of 100 followed by a 1 at the end.

Examples

			The first 10 terms are:
   n  a(n)  A352103(a(n))
  --  ----  -------------
   1    0               0
   2    1               1
   3    3              11
   4    5             101
   5    7             111
   6    8            1001
   7   14            1111
   8   18           10101
   9   23           11011
  10   27           11111
		

Crossrefs

A027084 is a subsequence.

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; IntegerDigits[Total[2^(s - 1)], 2]]; q[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, True, PalindromeQ[FromDigits[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[0, 1000], q]

A385436 Tribonacci array of the second kind, read by upward antidiagonals.

Original entry on oeis.org

0, 2, 1, 4, 5, 3, 6, 8, 10, 7, 9, 12, 16, 20, 14, 11, 18, 23, 31, 38, 27, 13, 21, 34, 44, 58, 71, 51, 15, 25, 40, 64, 82, 108, 132, 95, 17, 29, 47, 75, 119, 152, 200, 244, 176, 19, 32, 54, 88, 139, 220, 281, 369, 450, 325, 22, 36, 60, 101, 163, 257, 406, 518, 680
Offset: 1

Views

Author

A.H.M. Smeets, Jun 28 2025

Keywords

Comments

The array is, as a sequence, a permutation of the nonnegative integers; however it does not satisfy the conditions for interspersion and dispersion as given by Eric Weisstein's World of Mathematics. However, when all terms are increased by 1, it does satisfy the conditions for interspersion and dispersion!
Rows satisfy the recurrence: T(m,k) = 2*T(m,k-1) - T(m,k-4) for all k>4.
This array belongs to a family of Wythoff like arrays, based on binary number representations like the greedy and lazy Fibonacci number representations (see A035513 and A372501 for arrays), greedy and lazy Narayana number representations (A136189 for the array related to greedy representation).
The array is related to the lazy tribonacci number representation A352103. The first column lists the even numbers, i.e., for wich 0 suffix A352103(T(m,1)). The odd numbers are represented in the columns k > 1: A352103(T(m,k)) = A352103(T(m,1)) + 1^(k-1). Here + stands for concatenation and ^ stands for repeated concatenation.

Examples

			Array including some prepended columns (p = 1..4):
  p=4 p=3 p=2 p=1 | k=1 k=2 k=3  k=4  k=5  k=6  k=7   k=8   k=9  k=10
   -2  -1  -1  -1 |   0   1   3    7   14   27   51    95   176   325
   -2  -1   0   0 |   2   5  10   20   38   71  132   244   450   829
   -2   0   0   1 |   4   8  16   31   58  108  200   369   680
   -2   0   1   2 |   6  12  23   44   82  152  281   518
   -1   0   2   4 |   9  18  34   64  119  220  406   748
   -1   1   2   5 |  11  21  40   75  139  257  474   873
   -1   1   3   6 |  13  25  47   88  163  301  555  1022
   -1   1   4   7 |  15  29  54  101  187  345  636  1171
   -1   2   4   8 |  17  32  60  112  207  382  704  1296
   -1   2   5   9 |  19  36  67  125
    0   2   6  11 |  22  42  78  145
Each row of the array satisfies the recurrence relation T(m,k) = 2*T(m,k-1) - T(m,k-4); from this, the prepended columns are obtained by rowwise backward recursion.
		

Crossrefs

Prepended columns: A385455 (p=1), A385532 (p=2), A385533 (p=3).

Programs

  • Python
    def ToDual_111_Zeck(n):
        if n == 0:
            return "0"
        f0, f1, f2, sf = 1, 0, 0, 0
        while n > sf:
            f0, f1, f2 = f0+f1+f2, f0, f1
            sf += f0
        r, s = sf-n, "1"
        while f0 > 1:
            f0, f1, f2 = f1, f2, f0-f1-f2
            r, s = r%f0, s+str(1-r//f0)
        return s
    def From_111_Zeck(s):
        f0, f1, f2, i, n = 1, 1, 0, len(s), 0
        while i > 0:
            i -= 1
            f0, f1, f2, n = f0+f1+f2, f0, f1, n+int(s[i])*f0
        return n
    d, a, n, c1 = 0, 0, 0, []
    while d < 11:
        s = ToDual_111_Zeck(a)
        if s[len(s)-1] == "0": # == even
            n, d = n+1, d+1
            print(a, end = ", ")
            i, c1, p1 = d-1, c1+[s], ""
            while i > 0:
                n, i, p1 = n+1, i-1, p1+"1"
                print(From_111_Zeck(c1[i]+p1), end = ", ")
        a += 1

A018921 Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(4,8).

Original entry on oeis.org

4, 8, 15, 28, 52, 96, 177, 326, 600, 1104, 2031, 3736, 6872, 12640, 23249, 42762, 78652, 144664, 266079, 489396, 900140, 1655616, 3045153, 5600910, 10301680, 18947744, 34850335, 64099760, 117897840, 216847936, 398845537, 733591314, 1349284788, 2481721640
Offset: 0

Views

Author

Keywords

Comments

Not to be confused with the Pisot T(4,8) sequence, which is A020707. - R. J. Mathar, Feb 13 2016

Crossrefs

Cf. A008937.

Programs

  • Magma
    Tiv:=[4,8]; [n le 2 select Tiv[n] else Ceiling(Self(n-1)^2/Self(n-2))-1: n in [1..40]]; // Bruno Berselli, Feb 17 2016
  • Mathematica
    RecurrenceTable[{a[1] == 4, a[2] == 8, a[n] == Ceiling[a[n-1]^2/a[n-2]] - 1}, a, {n, 40}] (* Bruno Berselli, Feb 17 2016 *)
    LinearRecurrence[{2,0,0,-1},{4,8,15,28},40] (* Harvey P. Dale, Mar 05 2019 *)
  • PARI
    Vec((4-x^2-2*x^3)/((1-x)*(1-x-x^2-x^3)) + O(x^40)) \\ Colin Barker, Feb 13 2016
    
  • PARI
    T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=ceil(a[n-1]^2/a[n-2])-1); a
    T(4, 8, 30) \\ Colin Barker, Feb 14 2016
    

Formula

a(n) = 2*a(n-1) - a(n-4).
G.f.: (4-x^2-2*x^3) / ((1-x)*(1-x-x^2-x^3)). - Colin Barker, Feb 08 2012
a(n) = A008937(n+3) = A027084(n+3)+1. [first index correct by R. J. Mathar, Jun 24 2020]
a(n) = 2*a(n-1) - A008937(n). - Vincenzo Librandi, Feb 12 2016

Extensions

Comments moved to formula, and typo in data fixed by Colin Barker, Feb 13 2016

A317197 a(n) is the concatenation of A103269(n-i) for i = 0,1,2,...,n-1.

Original entry on oeis.org

1, 121, 1213121, 12131211213121, 121312112131212131211213121, 121312112131212131211213121312112131212131211213121, 12131211213121213121121312131211213121213121121312112131212131211213121312112131212131211213121
Offset: 1

Views

Author

N. J. A. Sloane, Aug 05 2018

Keywords

Comments

a(n) is a palindrome.
A027084 gives lengths of these words.

Examples

			a(3) = 1213.12.1 = 1213121.
		

Crossrefs

A360260 a(0) = 0, and for any n > 0, let k > 0 be as small as possible and such that T(3) + ... + T(2+k) >= n (where T(m) denotes A000073(m), the m-th tribonacci number); a(n) = k + a(T(3) + ... + T(2+k) - n).

Original entry on oeis.org

0, 1, 3, 2, 5, 6, 4, 3, 8, 10, 9, 6, 7, 5, 4, 12, 11, 14, 15, 13, 8, 9, 11, 10, 7, 8, 6, 5, 16, 17, 15, 14, 19, 21, 20, 17, 18, 10, 11, 13, 12, 15, 16, 14, 9, 10, 12, 11, 8, 9, 7, 6, 21, 23, 22, 19, 20, 18, 17, 25, 24, 27, 28, 26, 21, 22, 24, 23, 12, 13, 15
Offset: 0

Views

Author

Rémy Sigrist, Jan 31 2023

Keywords

Comments

See A356895 for the corresponding k's.
See A360259 for the Fibonacci variant.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k
  --  ----  ---
   0     0  N/A
   1     1    1
   2     3    2
   3     2    2
   4     5    3
   5     6    3
   6     4    3
   7     3    3
   8     8    4
   9    10    4
  10     9    4
  11     6    4
  12     7    4
  13     5    4
  14     4    4
  15    12    5
		

Crossrefs

Programs

  • PARI
    tribonacci(n) = ([0,1,0; 0,0,1; 1,1,1]^n)[2,1]
    { t = k = 0; print1 (0); for (n = 1, #a = vector(70), if (n > t, t += tribonacci(2+k++);); print1 (", "a[n] = k+if (t==n, 0, a[t-n]));); }

Formula

a(A027084(n)) = n - 1.

A181695 Triangle read by rows: T(n,m) = number of solutions x_1 + x_2 + ... + x_k <= n, where 1 <= x_i <= m, and any k >= 1.

Original entry on oeis.org

1, 2, 3, 3, 6, 7, 4, 11, 14, 15, 5, 19, 27, 30, 31, 6, 32, 51, 59, 62, 63, 7, 53, 95, 115, 123, 126, 127, 8, 87, 176, 223, 243, 251, 254, 255, 9, 142, 325, 431, 479, 499, 507, 510, 511, 10, 231, 599, 832, 943, 991, 1011, 1019, 1022, 1023, 11, 375, 1103, 1605
Offset: 1

Views

Author

Max Alekseyev, Nov 17 2010

Keywords

Examples

			Triangle begins:
  1;
  2,   3;
  3,   6,   7;
  4,  11,  14,  15;
  5,  19,  27,  30,  31;
  6,  32,  51,  59,  62,  63;
  7,  53,  95, 115, 123, 126, 127;
  ...
Could also be extended to a square array:
  1,   1,   1,   1,   1,   1,   1, ...
  2,   3,   3,   3,   3,   3,   3, ...
  3,   6,   7,   7,   7,   7,   7, ...
  4,  11,  14,  15,  15,  15,  15, ...
  5,  19,  27,  30,  31,  31,  31, ...
  6,  32,  51,  59,  62,  63,  63, ...
  7,  53,  95, 115, 123, 126, 127, ...
		

Crossrefs

Cf. A001911 (second column), A027084 (third column), A126198.

Programs

  • PARI
    { T(n,m) = sum(i=0, n\(m+1), binomial(n-m*i,i) * (-1)^i * 2^(n-(m+1)*i) ) - 1 }

Formula

For a fixed m, generating function is 1/(1-2*x+x^(m+1)) - 1/(1-x).
T(n,m) = Sum_{i=0..floor(n/(m+1))} binomial(n-mi, i)*(-1)^i*2^(n-(m+1)i) - 1.
T(n,m) = 2^m - 1 + Sum_{j=m+1..n} A126198(j,m).
Showing 1-8 of 8 results.