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.

A095263 a(n+3) = 3*a(n+2) - 2*a(n+1) + a(n).

Original entry on oeis.org

1, 3, 7, 16, 37, 86, 200, 465, 1081, 2513, 5842, 13581, 31572, 73396, 170625, 396655, 922111, 2143648, 4983377, 11584946, 26931732, 62608681, 145547525, 338356945, 786584466, 1828587033, 4250949112, 9882257736, 22973462017, 53406819691
Offset: 1

Views

Author

Gary W. Adamson, May 31 2004

Keywords

Comments

a(n+1) = number of n-tuples over {0,1,2} without consecutive digits. For the general case see A096261.
Diagonal sums of Riordan array (1/(1-x)^3, x/(1-x^3)), A127893. - Paul Barry, Jan 07 2008
The signed variant (-1)^(n+1)*a(n+1) is the bottom right entry of the n-th power of the matrix [[0,1,0],[0,0,1],[-1,-2,-3]]. - Roger L. Bagula, Jul 01 2007
a(n) is the number of generalized compositions of n+1 when there are i^2/2-i/2 different types of i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Dedrickson (Section 4.1) gives a bijection between colored compositions of n, where each part k has one of binomial(k,2) colors, and 0,1,2 strings of length n-2 without sequential digits (i.e., avoiding 01 and 12). Cf. A052529. - Peter Bala, Sep 17 2013
Except for the initial 0, this is the p-INVERT of (1,1,1,1,1,...) for p(S) = 1 - S^2 - S^3; see A291000. - Clark Kimberling, Aug 24 2017
For n>1, a(n-1) is the number of ways to split [n] into an unspecified number of intervals and then choose 2 blocks (i.e., subintervals) from each interval. For example, for n=6, a(5)=37 since the number of ways to split [6] into intervals and then select 2 blocks from each interval is C(6,2) + C(4,2)*C(2,2) + C(3,2)*C(3,2) + C(2,2)*C(4,2) + C(2,2)*C(2,2)*C(2,2). - Enrique Navarrete, May 20 2022

Examples

			a(9) = 1081 = 3*465 - 2*200 + 86.
M^9 * [1 0 0] = [a(7) a(8) a(9)] = [200 465 1081].
G.f. = x + 3*x^2 + 7*x^3 + 16*x^4 + 37*x^5 + 86*x^6 + 200*x^7 + ...
		

Crossrefs

Cf. A052921 (first differences), A137229 (partial sums).
Column k=3 of A277666.

Programs

  • Magma
    I:=[1,3,7]; [n le 3 select I[n] else 3*Self(n-1) -2*Self(n-2) +Self(n-3): n in [1..30]]; // G. C. Greubel, Apr 12 2021
    
  • Maple
    A:= gfun:-rectoproc({a(n+3)=3*a(n+2)-2*a(n+1)+a(n),a(1)=1,a(2)=3,a(3)=7},a(n),remember):
    seq(A(n),n=1..100); # Robert Israel, Sep 15 2014
  • Mathematica
    a[1]=1; a[2]=3; a[3]=7; a[n_]:= a[n]= 3a[n-1] -2a[n-2] +a[n-3]; Table[a[n], {n, 22}] (* Or *)
    a[n_]:= (MatrixPower[{{0,1,2,3}, {1,2,3,0}, {2,3,0,1}, {3,0,1,2}}, n].{{1}, {0}, {0}, {0}})[[2, 1]]; Table[ a[n], {n, 22}] (* Robert G. Wilson v, Jun 16 2004 *)
    RecurrenceTable[{a[1]==1,a[2]==3,a[3]==7,a[n+3]==3a[n+2]-2a[n+1]+a[n]},a,{n,30}] (* Harvey P. Dale, Sep 17 2022 *)
  • Sage
    [sum( binomial(n+k+1,3*k+2) for k in (0..(n-1)//2)) for n in (1..30)] # G. C. Greubel, Apr 12 2021

Formula

Let M = the 3 X 3 matrix [0 1 0 / 0 0 1 / 1 -2 3]; then M^n *[1 0 0] = [a(n-2) a(n-1) a(n)].
a(n)/a(n-1) tends to 2.3247179572..., an eigenvalue of M and a root of the characteristic polynomial. [Is that constant equal to 1 + A060006? - Michel Marcus, Oct 11 2014] [Yes, the limit is the root of the equation -1 + 2*x - 3*x^2 + x^3 = 0, after substitution x = y + 1 we have the equation for y: -1 - y + y^3 = 0, y = A060006. - Vaclav Kotesovec, Jan 27 2015]
Related to the Padovan sequence A000931 as follows : a(n)=A000931(3n+4). Also the binomial transform of A000931(n+4).
From Paul Barry, Jul 06 2004: (Start)
a(n) = Sum_{k=0..floor((n+1)/2)} binomial(n+k, n-2*k+1).
a(n) = Sum_{k=0..floor((n+1)/2)} binomial(n+k, 3*k-1). (End)
From Paul Barry, Jan 07 2008: (Start)
G.f.: x/(1 -3*x +2*x^2 -x^3).
a(n) = Sum_{k=0..floor(n/2)} binomial(n+k+2,3*k+2).
a(n) = Sum_{k=0..n} binomial(n,k) * Sum_{j=0..floor((k+4)/2)} binomial(j,k-2j+4). (End)
If p[i]=i(i-1)/2 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>=2, a(n-1)=det A. - Milan Janjic, May 02 2010
a(n) = A000931(3*n + 4). - Michael Somos, Sep 18 2012

Extensions

Edited by Paul Barry, Jul 06 2004
Corrected and extended by Robert G. Wilson v, Jun 05 2004

A034943 Binomial transform of Padovan sequence A000931.

Original entry on oeis.org

1, 1, 1, 2, 5, 12, 28, 65, 151, 351, 816, 1897, 4410, 10252, 23833, 55405, 128801, 299426, 696081, 1618192, 3761840, 8745217, 20330163, 47261895, 109870576, 255418101, 593775046, 1380359512, 3208946545
Offset: 0

Views

Author

Keywords

Comments

Trisection of the Padovan sequence: a(n) = A000931(3n). - Paul Barry, Jul 06 2004
a(n+1) gives diagonal sums of Riordan array (1/(1-x),x/(1-x)^3). - Paul Barry, Oct 11 2005
a(n+2) is the sum, over all Boolean n-strings, of the product of the lengths of the runs of 1. For example, the Boolean 7-string (0,1,1,0,1,1,1) has two runs of 1s. Their lengths, 2 and 3, contribute a product of 6 to a(9). The 8 Boolean 3-strings contribute to a(5) as follows: 000 (empty product), 001, 010, 100, 101 all contribute 1, 011 and 110 contribute 2, 111 contributes 3. - David Callan, Nov 29 2007
[a(n), a(n+1), a(n+2)], n > 0, = [0,1,0; 0,0,1; 1,-2,3]^n * [1,1,1]. - Gary W. Adamson, Mar 27 2008
Without the initial 1 and 1: 1, 2, 5, 12, 28, this is also the transform of 1 by the T_{1,0} transformation; see Choulet link. - Richard Choulet, Apr 11 2009
Without the first 1: transform of 1 by T_{0,0} transformation (see Choulet link). - Richard Choulet, Apr 11 2009
Starting (1, 2, 5, 12, ...) = INVERT transform of (1, 1, 2, 3, 4, 5, ...) and row sums of triangle A159974. - Gary W. Adamson, Apr 28 2009
a(n+1) is also the number of 321-avoiding separable permutations. (A permutation is separable if it avoids both 2413 and 3142.) - Vince Vatter, Sep 21 2009
a(n+1) is an eigensequence of the sequence array for (1,1,2,3,4,5,...). - Paul Barry, Nov 03 2010
Equals the INVERTi transform of A055588: (1, 2, 4, 9, 22, 56, ...) - Gary W. Adamson, Apr 01 2011
The Ca3 sums, see A180662, of triangle A194005 equal the terms of this sequence without a(0) and a(1). - Johannes W. Meijer, Aug 16 2011
Without the initial 1, a(n) = row sums of A182097(n)*A007318(n,k); i.e., a Triangular array T(n,k) multiplying the binomial (Pascal's) triangle by the Padovan sequence where a(0) = 1, a(1) = 0 and a(2) = 1. - Bob Selcoe, Jun 28 2013
a(n+1) is the top left entry of the n-th power of any of the 3 X 3 matrices [1, 1, 1; 0, 1, 1; 1, 0, 1] or [1, 1, 0; 1, 1, 1; 1, 0, 1] or [1, 1, 1; 1, 1, 0; 0, 1, 1] or [1, 0, 1; 1, 1, 0; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
a(n) is the top left entry of the n-th power of the 3 X 3 matrix [1, 0, 1; 1, 1, 1; 0, 1, 1] or of the 3 X 3 matrix [1, 1, 0; 0, 1, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
Number of sequences (e(1), ..., e(n-1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) != e(j) < e(k) and e(i) <= e(k). [Martinez and Savage, 2.8] - Eric M. Schmidt, Jul 17 2017
a(n+1) is the number of words of length n over the alphabet {0,1,2} that do not contain the substrings 01 or 12 and do not start with a 2 and do not end with a 0. - Yiseth K. Rodríguez C., Sep 11 2020

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + 5*x^4 + 12*x^5 + 28*x^6 + 65*x^7 + 151*x^8 + ...
		

Crossrefs

Programs

  • Magma
    [n le 3 select 1 else 3*Self(n-1)-2*Self(n-2)+Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 14 2012
    
  • Maple
    A034943 := proc(n): add(binomial(n+k-1, 3*k), k=0..floor(n/2)) end: seq(A034943(n), n=0..28); # Johannes W. Meijer, Aug 16 2011
  • Mathematica
    LinearRecurrence[{3,-2,1},{1,1,1},30] (* Harvey P. Dale, Aug 11 2017 *)
  • PARI
    {a(n) = if( n<1, n = 0-n; polcoeff( (1 - x + x^2) / (1 - 2*x + 3*x^2 - x^3) + x * O(x^n), n), n = n-1; polcoeff( (1 - x + x^2) / (1 - 3*x + 2*x^2 - x^3) + x * O(x^n), n))} /* Michael Somos, Mar 31 2012 */
    
  • SageMath
    @CachedFunction
    def a(n): # a = A034943
        if (n<3): return 1
        else: return 3*a(n-1) - 2*a(n-2) + a(n-3)
    [a(n) for n in range(51)] # G. C. Greubel, Apr 22 2023

Formula

a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3).
a(n) = Sum_{k=0..floor(n/2)} binomial(n+k-1, 3*k). - Paul Barry, Jul 06 2004
G.f.: (1 - 2*x)/(1 - 3*x + 2*x^2 - x^3). - Paul Barry, Jul 06 2005
G.f.: 1 + x / (1 - x / (1 - x / (1 - x / (1 + x / (1 - x))))). - Michael Somos, Mar 31 2012
a(-1 - n) = A185963(n). - Michael Somos, Mar 31 2012
a(n) = A095263(n) - 2*A095263(n-1). - G. C. Greubel, Apr 22 2023

Extensions

Edited by Charles R Greathouse IV, Apr 20 2010

A052921 Expansion of (1 - x)/(1 - 3*x + 2*x^2 - x^3).

Original entry on oeis.org

1, 2, 4, 9, 21, 49, 114, 265, 616, 1432, 3329, 7739, 17991, 41824, 97229, 226030, 525456, 1221537, 2839729, 6601569, 15346786, 35676949, 82938844, 192809420, 448227521, 1042002567, 2422362079, 5631308624, 13091204281, 30433357674, 70748973084, 164471408185
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

First differences of A095263. - R. J. Mathar, Nov 23 2011
Partial sums of A034943 starting (1, 1, 2, 5, 12, 28, 65, ...). - Gary W. Adamson, Feb 15 2012
a(n) is the number of n (decimal) digit integers x such that all digits of x are odd and all digits of 6x are even. - Robert Israel, Apr 17 2014
a(n) is the number of words of length n over the alphabet {0,1,2} that do not contain the substrings 01 or 12 and do not end in 0. - Yiseth K. Rodríguez C., Sep 11 2020

Examples

			G.f. = 1 + 2*x + 4*x^2 + 9*x^3 + 21*x^4 + 49*x^5 + 114*x^6 + 265*x^7 + ...
		

Crossrefs

Programs

  • GAP
    a:=[1,2,4];; for n in [4..40] do a[n]:=3*a[n-1]-2*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Oct 16 2019
    
  • Magma
    I:=[1,2,4]; [n le 3 select I[n] else 3*Self(n-1)-2*Self(n-2) +Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 14 2012
    
  • Magma
    R:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)/(1-3*x+2*x^2-x^3) )); // Marius A. Burtea, Oct 16 2019
  • Maple
    spec := [S,{S=Sequence(Union(Z,Z,Prod(Sequence(Z),Z,Z,Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..29);
    A052921 := proc(n): add(binomial(n+k+1, n-2*k),k=0..n+1) end: seq(A052921(n), n=0..29); # Johannes W. Meijer, Aug 16 2011
  • Mathematica
    LinearRecurrence[{3,-2,1},{1,2,4},40] (* Vincenzo Librandi, Feb 14 2012 *)
    CoefficientList[Series[(1-x)/(1-3*x+2*x^2-x^3),{x,0,30}],x] (* Harvey P. Dale, Nov 09 2019 *)
  • PARI
    my(x='x+O('x^40)); Vec((1-x)/(1 -3*x +2*x^2 -x^3)) \\ G. C. Greubel, Oct 16 2019
    
  • Sage
    def A077952_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((1-x)/(1 -3*x +2*x^2 -x^3)).list()
    A077952_list(40) # G. C. Greubel, Oct 16 2019
    

Formula

G.f.: (1 - x)/(1 - 3*x + 2*x^2 - x^3).
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3), with a(0)=1, a(1)=2, a(2)=4.
a(n) = Sum_{alpha=RootOf(-1 + 3*z - 2*z^2 + z^3)} (1/23)*(8 - 5*alpha + 7*alpha^2)*alpha^(-1-n).
From Paul Barry, Jun 21 2004: (Start)
Binomial transform of the Padovan sequence A000931(n+5).
a(n) = Sum_{k=0..n+1} C(n+k+1, n-2*k). (End)
a(n) = A000931(3*n + 5). - Michael Somos, Sep 18 2012
a(n) = Sum_{i=1..n+1} A000931(3*i). - David Nacin, Nov 03 2019

A159347 Transform of the finite sequence (1, 0, -1) by the T_{0,0} transformation.

Original entry on oeis.org

1, 1, 1, 4, 10, 23, 53, 123, 286, 665, 1546, 3594, 8355, 19423, 45153, 104968, 244021, 567280, 1318766, 3065759, 7127025, 16568323, 38516678, 89540413, 208156206, 483904470, 1124941411, 2615171499, 6079536145, 14133206848, 32855719753
Offset: 0

Views

Author

Richard Choulet, Apr 11 2009

Keywords

Comments

Without the first two 1's: A137531.

Crossrefs

Cf. A137531.

Programs

  • Magma
    I:=[1,4,10]; [1,1] cat [n le 3 select I[n] else 3*Self(n-1) - 2*Self(n-2) + Self(n-3): n in [1..50]]; // G. C. Greubel, Jun 16 2018
  • Maple
    a(0):=1: a(1):=1:a(2):=1: a(3):=4:a(4):=10:for n from 2 to 31 do a(n+3):=3*a(n+2)-2*a(n+1)+a(n):od:seq(a(i),i=0..31);
  • Mathematica
    Join[{1,1}, LinearRecurrence[{3,-2,1}, {1,4,10}, 50]] (* G. C. Greubel, Jun 16 2018 *)
  • PARI
    m=50; v=concat([1,4,10], vector(m-3)); for(n=4, m, v[n] = 3*v[n-1] -2*v[n-2] +v[n-3] ); concat([1,1], v) \\ G. C. Greubel, Jun 16 2018
    

Formula

O.g.f.: f(z) = ((1-z)^2/(1 - 3*z + 2*z^2 - z^3))*(1-z^2).
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3) for n >= 5, with a(0)=1, a(1)=1, a(2)=1, a(3)=4, a(4)=10.
a(n) = A137531(n-2).

A159348 Transform of the finite sequence (1, 0, -1, 0, 1) by the T_{0,0} transform (see link).

Original entry on oeis.org

1, 1, 1, 4, 11, 24, 55, 128, 298, 693, 1611, 3745, 8706, 20239, 47050, 109378, 254273, 591113, 1374171, 3194560, 7426451, 17264404, 40134870, 93302253, 216901423, 504234633, 1172203306, 2725042075, 6334954246, 14726981894, 34236079265
Offset: 0

Views

Author

Richard Choulet, Apr 11 2009

Keywords

Crossrefs

Programs

  • Magma
    I:=[11,24,55]; [1,1,1,4] cat [n le 3 select I[n] else 3*Self(n-1) - 2*Self(n-2) +Self(n-3): n in [1..30]]; // G. C. Greubel, Jun 16 2018
  • Maple
    a(0):=1: a(1):=1:a(2):=1: a(3):=4:a(4):=11:a(5):=24:a(6):=55:for n from 4 to 31 do a(n+3):=3*a(n+2)-2*a(n+1)+a(n):od:seq(a(i),i=0..31);
  • Mathematica
    Join[{1,1,1,4},LinearRecurrence[{3,-2,1},{11,24,55},40]] (* or *) CoefficientList[Series[(-1+2 x-2 x^3+2 x^5-x^6)/(-1+3 x-2 x^2+x^3),{x,0,45}],x](* Harvey P. Dale, Oct 04 2011 *)
  • PARI
    m=50; v=concat([11, 24, 55], vector(m-3)); for(n=4, m, v[n]= 3*v[n-1] -2*v[n-2] +v[n-3]); concat([1,1,1,4], v) \\ G. C. Greubel, Jun 16 2018
    

Formula

O.g.f.: f(z) = ((1-z)^2/(1-3*z+2*z^2-z^3))*(1-z^2+z^4).
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3) for n>=7, with a(0)=1, a(1)=1, a(2)=1, a(3)=4, a(4)=11, a(5)=24, a(6)=55.

A159349 Transform of the finite sequence (1, 0, -1, 0, 1, 0, -1) by the T_{0,0} transformation (see link).

Original entry on oeis.org

1, 1, 1, 4, 11, 24, 56, 129, 300, 698, 1623, 3773, 8771, 20390, 47401, 110194, 256170, 595523, 1384423, 3218393, 7481856, 17393205, 40434296, 93998334, 218519615, 507996473, 1180948523, 2745372238, 6382216141, 14836852470, 34491497366
Offset: 0

Views

Author

Richard Choulet, Apr 11 2009

Keywords

Crossrefs

Programs

  • Magma
    I:=[56, 129, 300]; [1,1,1,4,11,24] cat [n le 3 select I[n] else 3*Self(n-1) - 2*Self(n-2) +Self(n-3): n in [1..50]]; // G. C. Greubel, Jun 16 2018
  • Maple
    a(0):=1: a(1):=1:a(2):=1: a(3):=4:a(4):=11:a(5):=24:a(6):=56:a(7):=129:a(8):=300:for n from 6 to 31 do a(n+3):=3*a(n+2)-2*a(n+1)+a(n):od:seq(a(i),i=0..31);
  • Mathematica
    Join[{1, 1, 1, 4, 11, 24}, LinearRecurrence[{3, -2, 1}, {56, 129, 300}, 95]] (* G. C. Greubel, Jun 16 2018 *)
  • PARI
    m=50; v=concat([56,129,300], vector(m-3)); for(n=4, m, v[n]= 3*v[n-1] -2*v[n-2] +v[n-3]); concat([1,1,1,4,11,24], v) \\ G. C. Greubel, Jun 16 2018
    

Formula

O.g.f.: (1-2x+2x^3-2x^5+2x^6-2x^7+x^8)/(1-3x+2x^2-x^3). [corrected by Georg Fischer, May 19 2019]
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3) for n>=9, with a(0)=1, a(1)=1, a(2)=1, a(3)=4, a(4)=11, a(5)=24, a(6)=56, a(7)=129, a(8)=300.

A159350 Transform of A056594 by the T_{0,0} transformation (see link).

Original entry on oeis.org

1, 1, 1, 4, 11, 24, 54, 127, 297, 689, 1600, 3721, 8652, 20112, 46753, 108689, 252673, 587392, 1365519, 3174448, 7379698, 17155715, 39882197, 92714861, 215535904, 501060185, 1164823608, 2707886360, 6295072049, 14634267033, 34020543361
Offset: 0

Views

Author

Richard Choulet, Apr 11 2009

Keywords

Crossrefs

Programs

  • Magma
    I:=[1,1,1,4,11]; [n le 5 select I[n] else 3*Self(n-1) - 3*Self(n-2) +4*Self(n-3) -2*Self(n-4) + Self(n-5): n in [1..50]]; // G. C. Greubel, Jun 15 2018
  • Maple
    a(0):=1: a(1):=1: a(2):=1: a(3):=4: a(4):=11: for n from 0 to 31 do a(n+5):=3*a(n+4)-3*a(n+3)+4*a(n+2)-2*a(n+1)+a(n): od: seq(a(i),i=0..31);
  • Mathematica
    LinearRecurrence[{3,-3,4,-2,1}, {1,1,1,4,11}, 50] (* G. C. Greubel, Jun 15 2018 *)
  • PARI
    x='x+O('x^50); Vec((1-x)^2/((1-3*x+2*x^2-x^3)*(1+x^2))) \\ G. C. Greubel, Jun 15 2018
    

Formula

O.g.f.: (1-z)^2/((1-3*z+2*z^2-z^3)*(1+z^2)).
a(n) = 3*a(n-1) - 3*a(n-2) + 4*a(n-3) - 2*a(n-4) + a(n-5) for n >= 5, with a(0)=1, a(1)=1, a(2)=1, a(3)=4, a(4)=11.

A137495 a(n) = A098601(2n) + A098601(2n+1).

Original entry on oeis.org

2, 3, 4, 7, 13, 23, 40, 70, 123, 216, 379, 665, 1167, 2048, 3594, 6307, 11068, 19423, 34085, 59815, 104968, 184206, 323259, 567280, 995507, 1746993, 3065759, 5380032, 9441298, 16568323, 29075380, 51023735, 89540413, 157132471, 275748264, 483904470, 849193147, 1490230088
Offset: 0

Views

Author

Paul Curtz, Apr 27 2008

Keywords

Crossrefs

Programs

Formula

a(3n) = A135364(2n+1). a(3n+1) = A137584(2n+1). a(3n+2) = A137531(2n+2).
From R. J. Mathar, Jul 06 2011: (Start)
G.f.: ( -2+x ) / ( -1+2*x-x^2+x^3 ).
a(n) = 2*A005314(n+1) - A005314(n). (End)
Showing 1-8 of 8 results.