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.

Previous Showing 11-20 of 38 results. Next

A028860 a(n+2) = 2*a(n+1) + 2*a(n); a(0) = -1, a(1) = 1.

Original entry on oeis.org

-1, 1, 0, 2, 4, 12, 32, 88, 240, 656, 1792, 4896, 13376, 36544, 99840, 272768, 745216, 2035968, 5562368, 15196672, 41518080, 113429504, 309895168, 846649344, 2313089024, 6319476736, 17265131520, 47169216512, 128868696064, 352075825152, 961889042432, 2627929735168
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the top left entry of the n-th power of the 3 X 3 matrix [0, 1, 1; 1, 1, 1; 1, 1, 1]. - R. J. Mathar, Feb 04 2014
(A002605, a(.+1)) is the canonical basis of the space of linear recurrent sequences with signature (2, 2), i.e., any sequence s(n) = 2(s(n-1) + s(n-2)) is given by s = s(0)*A002605 + s(1)*a(.+1). - M. F. Hasler, Aug 06 2018

Crossrefs

Programs

  • GAP
    a:=[-1,1];; for n in [3..30] do a[n]:=2*a[n-1]+2*a[n-2]; od; a; # Muniru A Asiru, Aug 07 2018
    
  • Haskell
    a028860 n = a028860_list !! n
    a028860_list =
       -1 : 1 : map (* 2) (zipWith (+) a028860_list (tail a028860_list))
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Magma
    I:=[-1,1]; [n le 2 select I[n] else 2*Self(n-1)+2*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 13 2018
    
  • Maple
    seq(coeff(series((3*x-1)/(1-2*x-2*x^2), x,n+1),x,n),n=0..30); # Muniru A Asiru, Aug 07 2018
  • Mathematica
    (With a different offset) M = {{0, 2}, {1, 2}} v[1] = {0, 1} v[n_] := v[n] = M.v[n - 1] a = Table[Abs[v[n][[1]]], {n, 1, 50}] (* Roger L. Bagula, May 29 2005 *)
    LinearRecurrence[{2,2},{-1,1},40] (* Harvey P. Dale, Dec 13 2012 *)
    CoefficientList[Series[(-3 x + 1)/(2 x^2 + 2 x - 1), {x, 0, 27}], x] (* Robert G. Wilson v, Aug 07 2018 *)
  • PARI
    apply( A028860(n)=([2,2;1,0]^n)[2,]*[1,-1]~, [0..30]) \\ 15% faster than (A^n*[1,-1]~)[2]. - M. F. Hasler, Aug 06 2018
    
  • SageMath
    A028860 = BinaryRecurrenceSequence(2,2,-1,1)
    [A028860(n) for n in range(51)] # G. C. Greubel, Dec 08 2022

Formula

a(n) = 4*A028859(n-4), for n > 3.
From R. J. Mathar, Nov 27 2008: (Start)
G.f.: -(1 - 3*x)/(1 - 2*x - 2*x^2).
a(n) = 3*A002605(n-1) - A002605(n). (End)
a(n) = det A, where A is the Hessenberg matrix of order n+1 defined by: A[i,j] = p(j - i + 1) (i <= j), A[i,j] = -1 (i = j + 1), A[i,j] = 0 otherwise, with p(i) = fibonacci(2i - 4). - Milan Janjic, May 08 2010, edited by M. F. Hasler, Aug 06 2018
a(n) = (2*sqrt(3) - 3)/6*(1 + sqrt(3))^n - (2*sqrt(3) + 3)/6*(1 - sqrt(3))^n. - Sergei N. Gladkovskii, Jul 18 2012
a(n) = 2*A002605(n-2) for n >= 2. - M. F. Hasler, Aug 06 2018
E.g.f.: exp(x)*(2*sqrt(3)*sinh(sqrt(3)*x) - 3*cosh(sqrt(3)*x))/3. - Franck Maminirina Ramaharo, Nov 11 2018

Extensions

Edited by N. J. A. Sloane, Apr 11 2009
Edited and initial values added in definition by M. F. Hasler, Aug 06 2018

A155020 a(n) = 2*a(n-1) + 2*a(n-2) for n > 2, a(0)=1, a(1)=1, a(2)=3.

Original entry on oeis.org

1, 1, 3, 8, 22, 60, 164, 448, 1224, 3344, 9136, 24960, 68192, 186304, 508992, 1390592, 3799168, 10379520, 28357376, 77473792, 211662336, 578272256, 1579869184, 4316282880, 11792304128, 32217174016, 88018956288, 240472260608, 656982433792, 1794909388800, 4903783645184, 13397386067968
Offset: 0

Views

Author

Philippe Deléham, Jan 19 2009

Keywords

Comments

Equals 1 followed by A028859. - Klaus Brockhaus, Jul 18 2009
a(n) is the number of ways to arrange 1- and 2-cent postage stamps (totaling n cents) in a row so that the first stamp is correctly placed and any subsequent stamp may (or not) be placed upside down.
Number of compositions of n into parts k >= 1 where there are F(k+1) = A000045(k+1) sorts of part k. - Joerg Arndt, Sep 30 2012
a(n) is the top-left entry of the n-th power of the 3 X 3 matrix [1, 1, 1; 1, 1, 1; 1, 1, 0] or of the 3 X 3 matrix [1, 1, 1; 1, 0, 1; 1, 1, 1].
From Tom Copeland, Nov 08 2014: (Start)
(Setting a(0)=0.)
This array is one of a family of Catalan arrays related by compositions of the special fractional linear (Möbius) transformations P(x,t) = x/(1-t*x); its inverse Pinv(x,t) = P(x,-t); and an o.g.f. of the Catalan numbers A000108, C(x) = (1-sqrt(1-4x))/2; and its inverse Cinv(x) = x*(1-x). (Cf. A091867.)
O.g.f.: G(x) = -P(P(Cinv(-x),1),1) = -P(Cinv(-x),2) = x(1+x)/(1-2x(1+x)) = (x+x^2)/(1-2(x+x^2)) = x + 3*x^2 + 8*x^3 + ... = A155020(x) with a(0)=0.
Ginv(x) = -C(P(P(-x,-1),-1)) = -C(P(-x,-2)) = (-1+sqrt(1+4*x/(1+2*x)))/2 = x*A064613(-x).
G(x) = x*(1+x) + 2*(x*(1+x))^2 + 2^2*(x*(1+x))^3 - ..., and so this array contains the row sums of A030528 * Diag(1, 2^1, 2^2, 2^3, ...). (End)
INVERT transform of Fibonacci(n+1). - Alois P. Heinz, Feb 11 2021

Examples

			a(2) = 3 because we have {1,1}, {1,_1} and {2}.
a(3) = 8 because we can order the stamps in eight ways: {1,1,1}  {1,1,_1}  {1,_1,1}  {1,_1,_1}  {2,1}   {2,_1}  {1,2}   {1,_2}, where _1 and _2 are upside down stamps.
a(4) = 22 = 2*3 + 2*8 because we can append 2 or _2 to the a(2) examples and 1 or _1 to the a(3) examples. - _Jon Perry_, Nov 10 2014
		

Crossrefs

Sequences of the form a(n) = m*(a(n-1) + a(n-2)) with a(0)=1, a(1) = m-1, a(2) = m^2 -1: this sequence (m=2), A155116 (m=3), A155117 (m=4), A155119 (m=5), A155127 (m=6), A155130 (m=7), A155132 (m=8), A155144 (m=9), A155157 (m=10).
Cf. A028859 (essentially the same sequence). - Klaus Brockhaus, Jul 18 2009
Row sums of A155112.

Programs

  • Magma
    I:=[1,1,3,8]; [n le 4 select I[n] else 2*Self(n-1)+2*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Nov 10 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n=0, 1,
          add(a(n-i)*combinat[fibonacci](1+i), i=1..n))
        end:
    seq(a(n), n=0..42);  # Alois P. Heinz, Feb 11 2021
  • Mathematica
    CoefficientList[Series[(1 -x -x^2)/(1 -2x -2x^2), {x,0,20}], x]
    With[{m=2}, LinearRecurrence[{m, m}, {1, m-1, m^2-1}, 30]] (* G. C. Greubel, Mar 25 2021 *)
  • Maxima
    makelist(sum(binomial(n-k,k)*2^(n-k-1),k,0,floor(n/2)),n,1,12); /* Emanuele Munarini, Feb 04 2014 */
    
  • PARI
    Vec( (1-x-x^2)/(1-2*x-2*x^2) + O(x^66) )  /* Joerg Arndt, Sep 30 2012 */
    
  • Sage
    [1]+[(-1)*(sqrt(2)*i)^(n-2)*chebyshev_U(n, -sqrt(2)*i/2) for n in (1..30)] # G. C. Greubel, Mar 25 2021

Formula

G.f.: (1 - x - x^2)/(1 - 2*x - 2*x^2).
G.f.: 1/( 1 - Sum_{k>=1} (x+x^2)^k ) - 1/( 1 - Sum_{k>=1} F(k+1)*x^k ) where F(k) = A000045(k). - Joerg Arndt, Sep 30 2012
a(n+1) = Sum_{k=0..n} A154929(n,k) = A028859(n).
a(n) = Sum_{k=0..floor(n/2)} ( binomial(n-k,k)*2^(n-k-1) ) for n > 0. - Emanuele Munarini, Feb 04 2014
a(n) = (1/2)*[n=0] - (sqrt(2)*i)^(n-2)*ChebyshevU(n, -sqrt(2)*i/2). - G. C. Greubel, Mar 25 2021
E.g.f.: (3 + exp(x)*(3*cosh(sqrt(3)*x) + sqrt(3)*sinh(sqrt(3)*x)))/6. - Stefano Spezia, Mar 02 2024

A022026 Define the 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) for n >= 0. This is T(2,15).

Original entry on oeis.org

2, 15, 112, 836, 6240, 46576, 347648, 2594880, 19368448, 144568064, 1079070720, 8054293504, 60118065152, 448727347200, 3349346516992, 24999862747136, 186601515909120, 1392812676284416, 10396095346638848, 77597512067973120, 579195715157229568
Offset: 0

Views

Author

Keywords

Comments

From Alois P. Heinz, Mar 18 2009: (Start)
a(n) is also the number of forests in the 2 X (n+1) grid.
a(0)=2, because there are 2 forests in the 2 X 1 grid: 1.2 and 1-2.
a(1)=15, because there are 15 forests in the 2 X 2 grid:
1.2 1-2 1.2 1.2 1.2 1-2 1-2 1-2 1.2 1.2 1.2 1.2 1-2 1-2 1-2
. . . . . | . . | . . | . . | . . | | | | . | | | . | | . |
4.3 4.3 4.3 4-3 4.3 4.3 4-3 4.3 4-3 4.3 4-3 4-3 4-3 4.3 4-3
a(n) = 8a(n-1) - 4a(n-2) for n>=2, because each of the a(n-1) forests can be extended by 8 patterns:
.o -o .o -o .o -o .o -o
.. .. .. .. .| .| .| .|
.o .o -o -o .o .o -o -o
where 4a(n-2) of these are not forests, namely the extensions of a(n-2) forests by 4 patterns:
.o-o -o-o .o-o -o-o
.| | .| | .| | .| |
.o-o .o-o -o-o -o-o (End)

Crossrefs

Equals A028859(2n+2)/4.

Programs

  • Maple
    a:= n-> (Matrix([[15,2]]). Matrix([[8, 1], [-4, 0]])^n)[1, 2]:
    seq(a(n), n=0..35);  # Alois P. Heinz, Mar 18 2009
  • Mathematica
    CoefficientList[Series[(2-x)/(1-8*x+4*x^2), {x, 0, 20}], x] (* Vaclav Kotesovec, May 03 2014 *)
  • PARI
    a(n)=([15,2]*[8,1;-4,0]^n)[2] \\ M. F. Hasler, Feb 10 2016

Formula

G.f.: (2-x)/(1-8x+4x^2). - David Boyd and Ralf Stephan, Apr 15 2004
From Peter Bala, May 03 2014: (Start)
a(n) = sum of the entries in the 2 X 2 matrix A^n where A is the 2 X 2 matrix [4, 4; 3, 4].
a(n) = (1 + 7*sqrt(3)/12)*(4 + 2*sqrt(3))^n + (1 - 7*sqrt(3)/12)*(4 - 2*sqrt(3))^n. See Desjarlais and Molina. (End)
a(n+1) = ceiling(a(n)^2/a(n-1))-1 for all n > 0. - M. F. Hasler, Feb 10 2016

A106435 a(n) = 3*a(n-1) + 3*a(n-2), a(0)=0, a(1)=3.

Original entry on oeis.org

0, 3, 9, 36, 135, 513, 1944, 7371, 27945, 105948, 401679, 1522881, 5773680, 21889683, 82990089, 314639316, 1192888215, 4522582593, 17146412424, 65006985051, 246460192425, 934401532428, 3542585174559, 13430960120961
Offset: 0

Views

Author

Roger L. Bagula, May 29 2005

Keywords

Comments

The first entry of the vector v[n] = M*v[n-1], where M is the 2 x 2 matrix [[0,3],[1,3]] and v[1] is the column vector [0,1]. The characteristic polynomial of the matrix M is x^2-3x-3.

Crossrefs

Programs

  • Haskell
    a106435 n = a106435_list !! n
    a106435_list = 0 : 3 : map (* 3) (zipWith (+) a106435_list (tail
    a106435_list))
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Magma
    a:=[0,3]; [n le 2 select a[n] else    3*Self(n-1) + 3*Self(n-2) : n in [1..24]]; // Marius A. Burtea, Jan 21 2020
    
  • Magma
    R:=PowerSeriesRing(Rationals(), 25); Coefficients(R!(3*x/(1-3*x-3*x^2))); // Marius A. Burtea, Jan 21 2020
    
  • Maple
    seq(coeff(series(3*x/(1-3*x-3*x^2), x, n+1), x, n), n = 0..30); # G. C. Greubel, Mar 12 2020
  • Mathematica
    LinearRecurrence[{3,3}, {0,3}, 30] (* G. C. Greubel, Mar 12 2020 *)
  • PARI
    a(n)=([0,3;1,3]^n)[1,2]
    
  • Sage
    [3^((n+1)/2)*i^(1-n)*chebyshev_U(n-1, i*sqrt(3)/2) for n in (0..30)] # G. C. Greubel, Mar 12 2020

Formula

G.f.: 3*x/(1-3*x-3*x^2). - Philippe Deléham, Nov 19 2008
From G. C. Greubel, Mar 12 2020: (Start)
a(n) = 3^((n+1)/2) * Fibonacci(n, sqrt(3)), where F(n, x) is the Fibonacci polynomial.
a(n) = 3^((n+1)/2)*i^(1-n)*ChebyshevU(n-1, i*sqrt(3)/2). (End)

Extensions

Edited by N. J. A. Sloane, May 20 2006 and May 29 2006
Offset corrected by Reinhard Zumkeller, Oct 15 2011

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

Original entry on oeis.org

1, 2, 4, 9, 20, 45, 101, 227, 510, 1146, 2575, 5786, 13001, 29213, 65641, 147494, 331416, 744685, 1673292, 3759853, 8448313, 18983187, 42654834, 95844542, 215360731, 483911170, 1087338529, 2443227497, 5489882353, 12335653674
Offset: 0

Views

Author

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

Keywords

Comments

Pairwise sums of A006356. Cf. A033303, A077850. - Ralf Stephan, Jul 06 2003
Number of (3412, P)-avoiding involutions in S_{n+1}, where P={1342, 1423, 2314, 3142, 2431, 4132, 3241, 4213, 21543, 32154, 43215, 15432, 53241, 52431, 42315, 15342, 54321}. - Ralf Stephan, Jul 06 2003
Number of 31- and 22-avoiding words of length n on alphabet {1,2,3} which do not end in 3 (e.g., at n=3, we have 111, 112, 121, 132, 211, 212, 232, 321 and 332). See A028859, A001519. - Jon Perry, Aug 04 2003
Form the graph with matrix A=[1, 1, 1; 1, 0, 0; 1, 0, 1]. Then the sequence 1,1,2,4,... with g.f. (1-x-x^2)/(1-2x-x^2+x^3) counts closed walks of length n at the degree 3 vertex. - Paul Barry, Oct 02 2004
a(n) is the number of Motzkin (n+1)-sequences whose flatsteps all occur at level <=1 and whose height is <=2. For example, a(5)=45 counts all 51 Motzkin 6-paths except FUUFDD, UFUFDD, UUFDDF, UUFDFD, UUFFDD, UUUDDD (the first five violate the flatstep restriction and the last violates the height restriction). - David Callan, Dec 09 2004
From Paul Barry, Nov 03 2010: (Start)
The g.f. of 1,1,2,4,9,... can be expressed as 1/(1-x/(1-x/(1-x^2))) and as 1/(1-x-x^2/(1-x-x^2)).
The second expression shows the link to the Motzkin numbers. (End)
From Emeric Deutsch, Oct 31 2010: (Start)
a(n) is the number of compositions of n into odd summands when we have two kinds of 1's. Proof: the g.f. of the set S={1,1',3,5,7,...} is g=2x+x^3/(1-x^2) and the g.f. of finite sequences of elements of S is 1/(1-g). Example: a(4)=20 because we have 1+3, 1'+3, 3+1, 3+1', and 2^4=16 of sums x+y+z+u, where x,y,z,u are taken from {1,1'}.
(End)
a(n-1) is the top left entry of the n-th power of any of the six 3 X 3 matrices [1, 1, 0; 1, 1, 1; 0, 1, 0] or [1, 1, 1; 0, 1, 1; 1, 1, 0] or [1, 0, 1; 1, 1, 1; 1, 1, 0] or [1, 1, 1; 1, 0, 1; 0, 1, 1] or [1, 0, 1; 0, 0, 1; 1, 1, 1] or [1, 1, 0; 1, 0, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014

Examples

			G.f. = 1 + 2*x + 4*x^2 + 9*x^3 + 20*x^4 + 45*x^5 + 101*x^6 + 227*x^7 + 510*x^8 + ... - _Michael Somos_, Dec 12 2023
		

Crossrefs

Programs

  • GAP
    a:=[1,2,4];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 09 2019
  • Magma
    [n le 3 select 2^(n-1) else 2*Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Mar 17 2015
    
  • Maple
    spec := [S,{S=Sequence(Union(Z,Prod(Z,Sequence(Prod(Z,Z)))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    LinearRecurrence[{2,1,-1},{1,2,4},40] (* Roman Witula, Aug 07 2012 *)
    CoefficientList[Series[(1-x^2)/(1-2x-x^2+x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 17 2015 *)
    a[ n_] := {0, 1, 0} . MatrixPower[{{1, 1, 1}, {1, 1, 0}, {1, 0, 0}}, n+1] . {0, 1, 0}; (* Michael Somos, Dec 12 2023 *)
  • Maxima
    h(n):=if n=0 then 1 else sum(sum(binomial(k,j)*binomial(j,n-3*k+2*j)*2^(3*k-n-j)*(-1)^(k-j),j,0,k),k,1,n); a(n):=if n<2 then h(n) else h(n)-h(n-2); /* Vladimir Kruchinin, Sep 09 2010 */
    
  • PARI
    my(x='x+O('x^40)); Vec((1-x^2)/(1-2*x-x^2+x^3)) \\ G. C. Greubel, May 09 2019
    
  • PARI
    {a(n) = [0, 1, 0] * [1, 1, 1; 1, 1, 0; 1, 0, 0]^(n+1) * [0, 1, 0]~}; /* Michael Somos, Dec 12 2023 */
    
  • SageMath
    ((1-x^2)/(1-2*x-x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 09 2019
    

Formula

G.f.: (1 - x^2)/(1 - 2*x - x^2 + x^3).
a(n) = 2*a(n-1) + a(n-2) - a(n-3), with a(0)=1, a(1)=2, a(2)=4.
a(n) = Sum_{alpha = RootOf(1-2*x-x^2+x^3)} (1/7)*(2 + alpha)*alpha^(-1-n).
a(n) = central term in the (n+1)-th power of the 3 X 3 matrix (shown in the example of A066170): [1 1 1 / 1 1 0 / 1 0 0]. E.g. a(6) = 101 since the central term in M^7 = 101. - Gary W. Adamson, Feb 01 2004
a(n) = A006054(n+2) - A006054(n). - Vladimir Kruchinin, Sep 09 2010
a(n) = A077998(n+2) - 2*A006054(n+2), which implies 7*a(n-2) = (2 + c(4) - 2*c(2))*(1 + c(1))^n + (2 + c(1) - 2*c(4))*(1 + c(2))^n + (2 + c(2) - 2*c(1))*(1 + c(4))^n, where c(j)=2*Cos(2Pi*j/7), a(-2)=a(-1)=1 since A077998 and A006054 are equal to the respective quasi-Fibonacci numbers. [Witula, Slota and Warzynski] - Roman Witula, Aug 07 2012
a(n+1) = A033303(n+1) - A033303(n). - Roman Witula, Sep 14 2012
a(n) = A006054(n+2)-A006054(n). - R. J. Mathar, Nov 23 2020
a(n) = A028495(-1-n) for all n in Z. - Michael Somos, Dec 12 2023

A154929 A Fibonacci convolution triangle.

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 5, 10, 6, 1, 8, 22, 21, 8, 1, 13, 45, 59, 36, 10, 1, 21, 88, 147, 124, 55, 12, 1, 34, 167, 339, 366, 225, 78, 14, 1, 55, 310, 741, 976, 770, 370, 105, 16, 1, 89, 566, 1557, 2422, 2337, 1443, 567, 136, 18, 1, 144, 1020, 3174, 5696, 6505, 4920, 2485
Offset: 0

Views

Author

Paul Barry, Jan 17 2009

Keywords

Comments

Row sums are A028859. Diagonal sums are A141015(n+1). Inverse is A154930. Product of A030528 and A007318.
Transforms sequence m^n with g.f. 1/(1-m*x) to the sequence with g.f. (1+x)/(1-(m+1)x-(m+1)x^2).
Subtriangle of triangle T(n,k), given by (0, 2, -1/2, -1/2, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. This triangle is the Riordan array (1, x(1+x)/(1-x-x^2)). - Philippe Deléham, Jan 25 2012

Examples

			Triangle begins
   1;
   2,   1;
   3,   4,   1;
   5,  10,   6,   1;
   8,  22,  21,   8,   1;
  13,  45,  59,  36,  10,   1;
  21,  88, 147, 124,  55,  12,   1;
  34, 167, 339, 366, 225,  78,  14,  1;
  55, 310, 741, 976, 770, 370, 105, 16, 1;
Production array is
     2,    1;
    -1,    2,   1;
     3,   -1,   2,   1;
   -10,    3,  -1,   2,  1;
    36,  -10,   3,  -1,  2,  1;
  -137,   36, -10,   3, -1,  2, 1;
   543, -137,  36, -10,  3, -1, 2, 1;
or ((1+x+sqrt(1+6x+5x^2))/2,x) beheaded.
T(5,3) = T(4,3) + T(4,2) + T(3,3) + T(3,2) = 8 + 21 + 1 + 6 = 36. - _Philippe Deléham_, Jan 18 2009
From _Philippe Deléham_, Jan 25 2012: (Start)
Triangle (0,2,-1/2,-1/2,0,0,0,...) DELTA (1,0,0,0,0,0,...) begins:
  1;
  0,   1;
  0,   2,   1;
  0,   3,   4,   1;
  0,   5,  10,   6,   1;
  0,   8,  22,  21,   8,   1;
  0,  13,  45,  59,  36,  10,   1;
  0,  21,  88, 147, 124,  55,  12,   1; (End)
		

Programs

  • Mathematica
    Table[Sum[Binomial[j + 1, n - j] Binomial[j, k], {j, 0, n}], {n, 0, 10}, {k, 0, n}] // Flatten (* Michael De Vlieger, Apr 25 2018 *)

Formula

Riordan array ((1+x)/(1-x-x^2), x(1+x)/(1-x-x^2));
Triangle T(n,k) = Sum_{j=0..n} C(j+1,n-j)*C(j,k).
T(n,k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k) + T(n-2,k-1), T(0,0)=1, T(1,0)=2, T(n,k)=0 if k > n. - Philippe Deléham, Jan 18 2009
Sum_{k=0..n} T(n,k)*x^k = A000045(n+1), A028859(n), A125145(n), A086347(n+1) for x=0,1,2,3 respectively. - Philippe Deléham, Jan 19 2009

A186244 Number of ternary strings of length n containing 00.

Original entry on oeis.org

0, 0, 1, 5, 21, 79, 281, 963, 3217, 10547, 34089, 108955, 345137, 1085331, 3392377, 10549739, 32667201, 100782787, 309946697, 950599131, 2908512145, 8880484019, 27064776729, 82350874699, 250212362465, 759269653155, 2301393567721, 6968615051195
Offset: 0

Views

Author

Toby Gottfried, Feb 15 2011

Keywords

Crossrefs

Cf. A028859, A186314 (number of ternary strings of length n containing 01), A351529 (4-ary), A351530 (5-ary).

Programs

  • Mathematica
    t = {0, 0, 1}; Do[AppendTo[t, 3 t[[-1]] + 2*(3^(n - 3) - t[[-3]])], {n, 3, 40}]; t (* T. D. Noe, Nov 11 2013 *)
    CoefficientList[Series[x^2/(3*x - 1)/(2*x^2 + 2*x - 1), {x,0,50}], x] (* G. C. Greubel, Feb 19 2017 *)
  • PARI
    x='x+O('x^50); Vec(x^2/(3*x - 1)/(2*x^2 + 2*x - 1)) \\ G. C. Greubel, Feb 19 2017
    
  • PARI
    a(n)=3^n - ([1, 3; 1, 1]^n*[2; 1])[2, 1] \\ Charles R Greathouse IV, Feb 19 2017

Formula

a(n) = 3*a(n-1) + 2*(3^(n-3) - a(n-3)). This recursive formula is based on adding any of {0,1,2} to strings of length n-1 which already have 00 in them, or {100,200} to strings of length n-3 which do not. For n = 3, we add {0,1,2} to 00, and {100,200} to the empty string to get the 5 strings of length 3 which have 00 in them. For n = 4, we add {0,1,2} to those 5, and {100,200} to all three strings of length 1, to get the 21 strings of length 4.
a(n) = -(1/3)*(1+sqrt(3))^n*sqrt(3) - (1/2)*(1+sqrt(3))^n + 3^n - (1/2)*(1-sqrt(3))^n + (1/3)*sqrt(3)*(1-sqrt(3))^n. - Alexander R. Povolotsky, Feb 18 2011
G.f.: x^2/(3*x-1)/(2*x^2+2*x-1). - Simon Plouffe, Feb 26 2011
a(n) = 3^n - A028859(n). - Toby Gottfried, Mar 06 2013
a(n) = 2*a(n-1) + 2*a(n-2) + 3^(n-2). This recursive formula is based on adding the case where the last two digits are not the same to the case where the last two digits are the same. In the first case, there are 2*a(n-1) strings, since any string of length n-1 containing 00 can be made into an appropriate string of length n by appending either of the values {0,1,2} that are not the same as the (n-1)-th digit. The case where the last two digits are the same has two subcases: to any string of length n-2 containing 00, we can append 11 or 22. There are 2*a(n-2) strings in this subcase. Or, to any string of length n-2 (whether or not it contains 00), we can append 00. There are 3^(n-2) strings in this subcase. - Todd CadwalladerOlsker, Oct 24 2020
a(n) = 5*a(n-1) - 4*a(n-2) - 6*a(n-3). - Kevin Ryde, Oct 24 2020
E.g.f.: exp(x)*(exp(2*x) - cosh(sqrt(3)*x) - 2*sinh(sqrt(3)*x)/sqrt(3)). - Stefano Spezia, Mar 02 2024

A274749 T(n,k)=Number of nXk 0..2 arrays with no element equal to any value at offset (-1,-2) (0,-1) or (-1,0) and new values introduced in order 0..2.

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 4, 8, 9, 4, 8, 22, 34, 27, 8, 16, 60, 133, 144, 81, 16, 32, 164, 518, 813, 610, 243, 32, 64, 448, 2017, 4554, 4967, 2584, 729, 64, 128, 1224, 7858, 25585, 40242, 30349, 10946, 2187, 128, 256, 3344, 30605, 143634, 327123, 355504, 185435, 46368
Offset: 1

Views

Author

R. H. Hardin, Jul 04 2016

Keywords

Comments

Table starts
...1.....1......2........4..........8...........16............32
...1.....3......8.......22.........60..........164...........448
...2.....9.....34......133........518.........2017..........7858
...4....27....144......813.......4554........25585........143634
...8....81....610.....4967......40242.......327123.......2661918
..16...243...2584....30349.....355504......4190533......49475642
..32...729..10946...185435....3140840.....53680592.....920432562
..64..2187..46368..1133025...27748676....687685512...17123659885
.128..6561.196418..6922887..245154340...8809672678..318581114142
.256.19683.832040.42299477.2165891856.112857546696.5927090659144

Examples

			Some solutions for n=4 k=4
..0..1..0..1. .0..1..0..2. .0..1..2..0. .0..1..0..2. .0..1..0..2
..1..0..1..2. .1..0..2..0. .1..2..1..2. .1..2..1..0. .1..0..1..0
..0..1..2..1. .0..1..0..2. .2..1..0..1. .2..1..0..1. .0..2..0..1
..2..0..1..2. .2..0..2..0. .0..2..1..2. .1..0..1..0. .2..0..2..0
		

Crossrefs

Column 1 is A000079(n-2).
Column 2 is A000244(n-1).
Column 3 is A014445.
Row 1 is A000079(n-2).
Row 2 is A028859(n-1).

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) for n>2
k=2: a(n) = 3*a(n-1)
k=3: a(n) = 4*a(n-1) +a(n-2)
k=4: a(n) = 6*a(n-1) +a(n-2) -2*a(n-3) for n>4
k=5: a(n) = 9*a(n-1) -14*a(n-3) +10*a(n-4) -2*a(n-5) for n>6
k=6: [order 9] for n>11
k=7: [order 13] for n>15
Empirical for row n:
n=1: a(n) = 2*a(n-1) for n>2
n=2: a(n) = 2*a(n-1) +2*a(n-2)
n=3: a(n) = 2*a(n-1) +7*a(n-2) +2*a(n-3) -2*a(n-4)
n=4: [order 8]
n=5: [order 16] for n>17
n=6: [order 36] for n>38
n=7: [order 80] for n>83

A083337 a(n) = 2*a(n-1) + 2*a(n-2); a(0)=0, a(1)=3.

Original entry on oeis.org

0, 3, 6, 18, 48, 132, 360, 984, 2688, 7344, 20064, 54816, 149760, 409152, 1117824, 3053952, 8343552, 22795008, 62277120, 170144256, 464842752, 1269974016, 3469633536, 9479215104, 25897697280, 70753824768, 193303044096, 528113737728, 1442833563648, 3941894602752, 10769456332800
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Apr 29 2003

Keywords

Crossrefs

Programs

  • Haskell
    a083337 n = a083337_list !! n
    a083337_list =
       0 : 3 : map (* 2) (zipWith (+) a083337_list (tail a083337_list))
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Mathematica
    CoefficientList[Series[3x/(1-2x-2x^2), {x, 0, 25}], x]
    s = Sqrt[3]; a[n_] := Simplify[s*((1 + s)^n - (1 - s)^n)/2]; Array[a, 30, 0] (* or *)
    LinearRecurrence[{2, 2}, {0, 3}, 31] (* Robert G. Wilson v, Aug 07 2018 *)
  • PARI
    apply( a(n)=([1,1;3,1]^n)[2,1], [0..30]) \\ or: ([2,2;1,0]^n)[2,1]*3. - M. F. Hasler, Aug 06 2018

Formula

G.f.: 3x/(1 - 2x - 2x^2).
a(n) = a(n-1) + 3*A026150(n-1). a(n)/A026150(n) converges to sqrt(3).
a(n) = lower left term of [1,1; 3,1]^n. - Gary W. Adamson, Mar 12 2008

Extensions

Edited and definition completed by M. F. Hasler, Aug 06 2018

A108898 a(n+3) = 3*a(n+2) - 2*a(n), a(0) = -1, a(1) = 1, a(2) = 3.

Original entry on oeis.org

-1, 1, 3, 11, 31, 87, 239, 655, 1791, 4895, 13375, 36543, 99839, 272767, 745215, 2035967, 5562367, 15196671, 41518079, 113429503, 309895167, 846649343, 2313089023, 6319476735, 17265131519, 47169216511, 128868696063, 352075825151, 961889042431, 2627929735167, 7179637555199
Offset: 0

Views

Author

Creighton Dement, Jul 16 2005

Keywords

Comments

In reference to the program code, "ibasek" corresponds to the floretion 'ik'. Sequences in this same batch are "kbase" = A005665 (Tower of Hanoi with cyclic moves only.) and "ibase" = A077846.

Crossrefs

Programs

  • Haskell
    a108898 n = a108898_list !! n
    a108898_list = -1 : 1 : 3 :
       zipWith (-) (map (* 3) $ drop 2 a108898_list) (map (* 2) a108898_list)
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Maple
    seriestolist(series((-1+4*x)/((x-1)*(2*x^2+2*x-1)), x=0,31)); -or- Floretion Algebra Multiplication Program, FAMP Code: 2ibaseksumseq[A*B] with A = + 'i + 'ii' + 'ij' + 'ik' and B = + .5'i + .5'j - .5'k + .5i' - .5j' + .5k' + .5'ij' + .5'ik' - .5'ji' - .5'ki'; Sumtype is set to:sum[(Y[0], Y[1], Y[2]),mod(3)
  • Mathematica
    LinearRecurrence[{3, 0, -2}, {-1, 1, 3}, 40] (* Paolo Xausa, Aug 21 2024 *)
  • PARI
    Vec(-(1 - 4*x) / ((1 - x)*(1 - 2*x - 2*x^2)) + O(x^40)) \\ Colin Barker, Apr 29 2019

Formula

a(n) = A028860(n+2)-1.
G.f.: (-1+4*x)/((x-1)*(2*x^2+2*x-1)).
From Colin Barker, Apr 29 2019: (Start)
a(n) = (-1 + (-(1-sqrt(3))^n + (1+sqrt(3))^n)/sqrt(3)).
a(n) = 3*a(n-1) - 2*a(n-3) for n>2.
(End)
Previous Showing 11-20 of 38 results. Next