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.

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

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 9, 14, 28, 47, 89, 155, 286, 507, 924, 1652, 2993, 5373, 9707, 17460, 31501, 56714, 102256, 184183, 331981, 598091, 1077870, 1942071, 3499720, 6305992, 11363361, 20475625, 36896355, 66484244, 119801329, 215873462, 388991876, 700937471
Offset: 0

Views

Author

Keywords

Comments

a(n+1) = S(n) for n>=1, where S(n) is the number of 01-words of length n, having first letter 1, in which all runlengths of 1's are odd. Example: S(4) counts 1000, 1001, 1010, 1110. See A077865. - Clark Kimberling, Jun 26 2004
For n>=1, number of compositions of n into floor(j/2) kinds of j's (see g.f.). - Joerg Arndt, Jul 06 2011
Counts walks of length n between the first and second nodes of P_3, to which a loop has been added at the end. Let A be the adjacency matrix of the graph P_3 with a loop added at the end. A is a 'reverse Jordan matrix' [0,0,1; 0,1,1; 1,1,0]. a(n) is obtained by taking the (1,2) element of A^n. - Paul Barry, Jul 16 2004
Interleaves A094790 and A094789. - Paul Barry, Oct 30 2004
a(n) appears in the formula for the nonnegative powers of rho:= 2*cos(Pi/7), the ratio of the smaller diagonal in the heptagon to the side length s=2*sin(Pi/7), when expressed in the basis <1,rho,sigma>, with sigma:=rho^2-1, the ratio of the larger heptagon diagonal to the side length, as follows. rho^n = C(n)*1 + C(n+1)*rho + a(n)*sigma, n>=0, with C(n) = A052547(n-2). See the Steinbach reference, and a comment under A052547. - Wolfdieter Lang, Nov 25 2010
If with the above notations the power basis <1,rho,rho^2> of Q(rho) is used, nonnegative powers of rho are given by rho^n = -a(n-1)*1 + A052547(n-1)*rho + a(n)*rho^2. For negative powers see A006054. - Wolfdieter Lang, May 06 2011
-a(n-1) also appears in the formula for the nonpositive powers of sigma (see the above comment for the definition, and the Steinbach basis <1,rho,sigma>) as follows: sigma^(-n) = A(n)*1 -a(n+1)*rho -A(n-1)*sigma, with A(n) = A052547(n), A(-1):=0. - Wolfdieter Lang, Nov 25 2010

Examples

			G.f. = x^2 + x^3 + 3*x^4 + 4*x^5 + 9*x^6 + 14*x^7 + 28*x^8 + 47*x^9 + ...
Regarding the description "number of compositions of n into floor(j/2) kinds of j's," the a(6)=9 compositions of 6 are (2a, 2a, 2a), (3a, 3a), (2a, 4a), (2a, 4b), (4a, 2a), (4b, 2a), (6a), (6b), (6c). - _Bridget Tenner_, Feb 25 2022
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. Witula, E. Hetmaniok and D. Slota, Sums of the powers of any order roots taken from the roots of a given polynomial, Proceedings of the 15th International Conference on Fibonacci Numbers and Their Applications (2012).

Crossrefs

Programs

  • Haskell
    a006053 n = a006053_list !! n
    a006053_list = 0 : 0 : 1 : zipWith (+) (drop 2 a006053_list)
       (zipWith (-) (map (2 *) $ tail a006053_list) a006053_list)
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [ n eq 1 select 0 else n eq 2 select 0 else n eq 3 select 1 else Self(n-1) +2*Self(n-2) -Self(n-3): n in [1..40] ]; // Vincenzo Librandi, Aug 19 2011
    
  • Maple
    a[0]:=0: a[1]:=0: a[2]:=1: for n from 3 to 40 do a[n]:=a[n-1]+2*a[n-2]-a[n-3] od:seq(a[n], n=0..40); # Emeric Deutsch
    A006053:=z**2/(1-z-2*z**2+z**3); # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    LinearRecurrence[{1,2,-1}, {0,0,1}, 50]  (* Vladimir Joseph Stephan Orlovsky, May 25 2011 *)
  • PARI
    {a(n) = if( n<0, n = -1-n; polcoeff( -1 / (1 - 2*x - x^2 + x^3) + x * O(x^n), n), polcoeff( x^2 / (1 - x - 2*x^2 + x^3) + x * O(x^n), n))}; /* Michael Somos, Nov 30 2014 */
    
  • SageMath
    @CachedFunction
    def a(n): # a = A006053
        if (n<3): return (n//2)
        else: return a(n-1) + 2*a(n-2) - a(n-3)
    [a(n) for n in range(41)] # G. C. Greubel, Feb 12 2023

Formula

G.f.: x^2/(1 - x - 2*x^2 + x^3). - Emeric Deutsch, Dec 14 2004
a(n) = c^(n-2) - a(n-1)*(c-1) + (1/c)*a(n-2) for n > 3 where c = 2*cos(Pi/7). Example: a(7) = 14 = c^5 - 9*(c-1) + 4/c = 18.997607... - 7.21743962... + 2.219832528... - Gary W. Adamson, Jan 24 2010
G.f.: -1 + 1/(1 - Sum_{j>=1} floor(j/2)*x^j). - Joerg Arndt, Jul 06 2011
a(n+2) = A094790(n/2+1)*(1+(-1)^n)/2 + A094789((n+1)/2)*(1-(-1)^n)/2. - Paul Barry, Oct 30 2004
First differences of A028495. - Floor van Lamoen, Nov 02 2005
a(n) = A187065(2*n+1); a(n+1) = A187066(2*n+1) = A187067(2*n). - L. Edson Jeffery, Mar 16 2011
a(n) = 2^n*(c(1)^(n-1)*(c(1)+c(2)) + c(3)^(n-1)*(c(3)+c(6)) + c(5)^(n-1)*(c(5)+c(4)) )/7, with c(j):=cos(Pi*j/7). - Herbert Kociemba, Dec 18 2011
a(n+1)*(-1)^n*49^(1/3) = (c(1)/c(4))^(1/3)*(2*c(1))^n + (c(2)/c(1))^(1/3)*(2*c(2))^n + (c(4)/c(2))^(1/3)*(2c(4))^n = (c(2)/c(1))^(1/3)*(2*c(1))^(n+1) + (c(4)/c(2))^(1/3)*(c(2))^(n+1) + (c(1)/c(4))^(1/3)*(2*c(4))^(n+1), where c(j) := cos(2Pi*j/7); for the proof, see Witula et al.'s papers. - Roman Witula, Jul 21 2012
The previous formula connects the sequence a(n) with A214683, A215076, A215100, A120757. We may call a(n) the Ramanujan-type sequence number 2 for the argument 2*Pi/7. - Roman Witula, Aug 02 2012
a(n) = -A006054(1-n) for all n in Z. - Michael Somos, Nov 30 2014
G.f.: x^2 / (1 - x / (1 - 2*x / (1 + 5*x / (2 - x / (5 - 2*x))))). - Michael Somos, Jan 20 2017
a(n) ~ r*c^n, where r=0.241717... is one of the roots of 49*x^3-7*x+1, and c=2*cos(Pi/7) (as in Gary W. Adamson's formula). - Daniel Checa, Nov 04 2022
a(2n-1) = 2*a(n+1)*a(n) - a(n)^2 - a(n-1)^2. - Richard Peterson, May 25 2023

Extensions

More terms from Emeric Deutsch, Dec 14 2004
Typo in definition fixed by Reinhard Zumkeller, Oct 14 2011

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

Original entry on oeis.org

1, 1, 3, 6, 14, 31, 70, 157, 353, 793, 1782, 4004, 8997, 20216, 45425, 102069, 229347, 515338, 1157954, 2601899, 5846414, 13136773, 29518061, 66326481, 149034250, 334876920, 752461609, 1690765888, 3799116465, 8536537209, 19181424995, 43100270734, 96845429254
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Let u(k), v(k), w(k) be defined by u(1)=1, v(1)=0, w(1)=0 and u(k+1)=u(k)+v(k)+w(k), v(k+1)=u(k)+v(k), w(k+1)=u(k); then {u(n)} = 1,1,3,6,14,31,... (A006356 with an extra initial 1), {v(n)} = 0,1,2,5,11,25,... (A006054 with its initial 0 deleted) and {w(n)} = {u(n)} prefixed by an extra 0 = this sequence with an extra initial 0. - Benoit Cloitre, Apr 05 2002 [Also u(k)^2+v(k)^2+w(k)^2 = u(2k). - Gary W. Adamson, Dec 23 2003]
Form the graph with matrix A=[1, 1, 1; 1, 0, 0; 1, 0, 1]. Then A077998 counts closed walks of length n at the vertex of degree 4. - Paul Barry, Oct 02 2004
a(n) is the number of Motzkin (n+2)-sequences with no flatsteps at ground level and whose height is <=2. For example, a(3)=6 counts UDUFD, UFDUD, UFFFD, UFUDD, UUDFD, UUFDD. - David Callan, Dec 09 2004
Number of compositions of n if there are two kinds of part 2. Example: a(3)=6 because we have (3),(1,2),(1,2'),(2,1),(2',1) and (1,1,1). Row sums of A105477. - Emeric Deutsch, Apr 09 2005
Diagonal sums of A056242. - Paul Barry, Dec 26 2007
Diagonal sums of triangle in A105306. - Philippe Deléham, Nov 16 2008
a(n) appears in the formula for the nonpositive powers of rho:= 2*cos(Pi/7), the ratio of the smaller diagonal in the heptagon to the side length s=2*sin(Pi/7), when expressed in the basis <1,rho,sigma>, with sigma:=rho^2-1, the ratio of the larger heptagon diagonal to the side length, as follows. rho^(-n) = a(n)*1 + a(n-1)*rho - C(n)*sigma, n>=0, with C(n)=A006054(n+1). Put a(-1):=0. See the Steinbach reference, and a comment under A052547.
The limit a(n+1)/a(n) for n -> infinity is sigma = rho^2-1, approximately 2.246979603. See a Nov 07 2013 comment on A006054 for the proof, and the preceding comment for rho and sigma and the P. Steinbach reference. - Wolfdieter Lang, Nov 07 2013
From Greg Dresden and Aaron Zhou, Jun 15 2023: (Start)
a(n) is the number of ways to tile a skew double-strip of 3*n cells using all possible "trominos". Here is the skew double-strip corresponding to n=4, with 12 cells:
_ ___ _ ___ _ ___
| | | | | | |
|__|___|_|___| |___|
| | | | | | |
|_|___|_|___|_|___|,
and here are the three possible "tromino" tiles, which can be rotated or reflected as needed:
_ _
| | | |
|__|_ ___|___| _________
| | | | | | | | | |
|_|___|, |_|___| , |_|___|_|.
As an example, here is one of the a(4) = 14 ways to tile the skew double-strip of 12 cells:
_ ___ _____ _______
| | | | |
| | |___ | |
| | | | |
|_____|_______|_|___|. (End)

Examples

			G.f. = 1 + x + 3*x^2 + 6*x^3 + 14*x^4 + 31*x^5 + 70*x^6 + 157*x^7 + 353*x^8 + ... - _Michael Somos_, Dec 12 2023
		

References

  • Kenneth Edwards, Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • Jay Kappraff, Beyond Measure, A Guided Tour Through Nature, Myth and Number, World Scientific, 2002.

Crossrefs

Apart from initial term, same as A006356, which is the main entry for this sequence. A106803 is yet another version.

Programs

  • GAP
    a:=[1,1,3];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jun 27 2019
  • Magma
    I:=[1,1,3]; [n le 3 select I[n] else 2*Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 01 2017
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2*x-x^2+x^3), {x, 0, 40}], x] (* Stefan Steinerberger, Sep 11 2006 *)
    LinearRecurrence[{2,1,-1},{1,1,3},40] (* Roman Witula, Aug 07 2012 *)
    a[ n_] := {1, 0, 0} . MatrixPower[{{0, 1, 0}, {0, 0, 1}, {-1, 1, 2}}, n] . {1, 1, 3}; (* Michael Somos, Dec 12 2023 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,1,2]^n*[1;1;3])[1,1] \\ Charles R Greathouse IV, May 10 2016
    
  • SageMath
    ((1-x)/(1-2*x-x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 27 2019
    

Formula

a(0)=a(1)=1, a(2)=3, a(n+1) = 2*a(n) + a(n-1) - a(n-2) for n>=2. - Philippe Deléham, Sep 07 2006
7*a(n) = (s(2))^2*(1+c(1))^n + (s(4))^2*(1+c(2))^n + (s(1))^2(1+c(4))^n, where c(j) = 2*Cos(2Pi*j/7) and s(j) = 2*Sin(2Pi*j/7) - for the proof of this one and many other relations for the sequences u(k), v(k) and w(k) defined on the top of the comments by Benoit Cloitre - see Witula et al.'s paper. - Roman Witula, Aug 07 2012
a(n) = b(n+2)- b(n+1), first differences of b(n) = A006054(n). - Wolfdieter Lang, Nov 07 2013; corrected by Kai Wang, May 31 2017
a(n) = A096976(-n) for all n in Z. - Michael Somos, Dec 12 2023

Extensions

Edited by N. J. A. Sloane, Aug 08 2008 at the suggestion of R. J. Mathar

A028495 Expansion of g.f. (1-x^2)/(1-x-2*x^2+x^3).

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 19, 33, 61, 108, 197, 352, 638, 1145, 2069, 3721, 6714, 12087, 21794, 39254, 70755, 127469, 229725, 413908, 745889, 1343980, 2421850, 4363921, 7863641, 14169633, 25532994, 46008619, 82904974, 149389218, 269190547, 485064009, 874055885
Offset: 0

Views

Author

Keywords

Comments

Form the graph with matrix A = [0,1,1; 1,0,0; 1,0,1] (P_3 with a loop at an extremity). Then A028495 counts closed walks of length n at the degree 3 vertex. - Paul Barry, Oct 02 2004
Equals INVERT transform of (1, 1, 0, 1, 0, 1, 0, 1, ...). - Gary W. Adamson, Apr 28 2009
From Johannes W. Meijer, May 29 2010: (Start)
a(n) is the number of ways White can force checkmate in exactly (n+1) moves, n>=0, ignoring the fifty-move and the triple repetition rules, in the following chess position: White Ka1, Ra8, Bc1, Nb8, pawns a6, a7, b2, c6, d2, f6 and h6; Black Kc8, pawns b3, c7, d3, f7 and h7. (After Noam D. Elkies, see link; diagram 5).
Counts all paths of length n, n>=0, starting at the initial node on the path graph P_6, see the second Maple program. (End)
a(n) is the number of length n-1 binary words such that each maximal block of 1's has odd length. a(4) = 6 because we have: 000, 001, 010, 100, 101, 111. - Geoffrey Critzer, Nov 17 2012
a(n) is the number of compositions of n where increments can only appear at every second position, starting with the second and third part, see example. Also, a(n) is the number of compositions of n where there is no fall between every second pair of parts, starting with the first and second part; see example. - Joerg Arndt, May 21 2013
a(n) is the top left entry of the n-th power of the 3 X 3 matrix [1, 1, 0; 1, 0, 1; 0, 1, 0] or of the 3 X 3 matrix [1, 0, 1; 0, 0, 1; 1, 1, 0]. - R. J. Mathar, Feb 03 2014
Range of row n of the circular Pascal array of order 7. - Shaun V. Ault, Jun 05 2014
a(n) is the number of compositions of n into parts from {1,2,4,6,8,10,...}. Example: a(4)= 6 because we have 4, 22, 211, 121, 112, and 1111. - Emeric Deutsch, Aug 17 2016
In general, a(n,m) = (2^n/(m+1))*Sum_{r=1..m} (1-(-1)^r)*cos(Pi*r/(m+1))^n*(1+cos(Pi*r/(m+1))) gives the number of paths of length n starting at the initial node on the path graph P_m. Here we have m=6. - Herbert Kociemba, Sep 15 2020
a(n-1) is the number of triangular dcc-polyominoes having area n (see Baril et al. at page 11). - Stefano Spezia, Oct 14 2023
a(n) is the number of permutations p of [n] with p(j)Alois P. Heinz, Mar 29 2024

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 19*x^6 + 33*x^7 + 61*x^8 + ...
From _Joerg Arndt_, May 21 2013: (Start)
There are a(6)=19 compositions of 6 where increments can only appear at every second position:
  01:  [ 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 2 ]
  03:  [ 1 1 2 1 1 ]
  04:  [ 1 1 2 2 ]
  05:  [ 1 1 3 1 ]
  06:  [ 1 1 4 ]
  07:  [ 2 1 1 1 1 ]
  08:  [ 2 1 2 1 ]
  09:  [ 2 1 3 ]
  10:  [ 2 2 1 1 ]
  11:  [ 2 2 2 ]
  12:  [ 3 1 1 1 ]
  13:  [ 3 1 2 ]
  14:  [ 3 2 1 ]
  15:  [ 3 3 ]
  16:  [ 4 1 1 ]
  17:  [ 4 2 ]
  18:  [ 5 1 ]
  19:  [ 6 ]
There are a(6)=19 compositions of 6 where there is no fall between every second pair of parts, starting with the first and second part:
  01:  [ 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 2 ]
  03:  [ 1 1 1 2 1 ]
  04:  [ 1 1 1 3 ]
  05:  [ 1 1 2 2 ]
  06:  [ 1 1 4 ]
  07:  [ 1 2 1 1 1 ]
  08:  [ 1 2 1 2 ]
  09:  [ 1 2 3 ]
  10:  [ 1 3 1 1 ]
  11:  [ 1 3 2 ]
  12:  [ 1 4 1 ]
  13:  [ 1 5 ]
  14:  [ 2 2 1 1 ]
  15:  [ 2 2 2 ]
  16:  [ 2 3 1 ]
  17:  [ 2 4 ]
  18:  [ 3 3 ]
  19:  [ 6 ]
(End)
19 = (1, 0, 1, 0, 1, 1) dot (1, 1, 2, 3, 6, 10) = (1 + 0 + 2 + 0 + 6 + 10). Cf. comment of Apr 28 2009. - _Gary W. Adamson_, Aug 10 2016
		

Crossrefs

Programs

  • Maple
    spec := [S,{S=Sequence(Union(Prod(Sequence(Prod(Z,Z)),Z,Z),Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    with(GraphTheory): P:=6: G:= PathGraph(P): A:=AdjacencyMatrix(G): nmax:=34; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k], k=1..P) od: seq(a(n), n=0..nmax); # Johannes W. Meijer, May 29 2010
    a := (-1)^(3/7) - (-1)^(4/7):
    b := (-1)^(5/7) - (-1)^(2/7):
    c := (-1)^(1/7) - (-1)^(6/7):
    f := n -> (a^n * (2 + a) + b^n * (2 + b) + c^n * (2 + c))/7:
    seq(simplify(f(n)), n=0..36); # Peter Luschny, Sep 16 2020
  • Mathematica
    LinearRecurrence[{1, 2, -1}, {1, 1, 2}, 60] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
    CoefficientList[Series[(1-x^2)/(1-x-2x^2+x^3),{x,0,40}],x] (* Harvey P. Dale, Dec 23 2018 *)
    a[n_,m_]:= 2^(n+1)/(m+1) Module[{x=(Pi r)/(m+1)},Sum[Cos[x]^n (1+Cos[x]),{r,1,m,2}]]
    Table[a[n,6],{n,0,40}]//Round (* Herbert Kociemba, Sep 15 2020 *) (* Herbert Kociemba, Sep 14 2020 *)
  • PARI
    {a(n) = if( n<0, n = -1-n; polcoeff( (1 - x^2) / (1 - 2*x - x^2 + x^3) + x * O(x^n), n), polcoeff( (1 - x^2) / (1 - x - 2*x^2 + x^3) + x * O(x^n), n))} /* Michael Somos, Apr 05 2012 */
    
  • PARI
    a(n)=([0,1,0;0,0,1;-1,2,1]^n*[1;1;2])[1,1] \\ Charles R Greathouse IV, Aug 25 2016

Formula

Recurrence: {a(0)=1, a(1)=1, a(2)=2, a(n)-2*a(n+1)-a(n+2)+a(n+3)=0}.
a(n) = Sum_(1/7*(1+2*_alpha)*_alpha^(-1-n), _alpha=RootOf(_Z^3-2*_Z^2-_Z+1)).
a(n) = A094718(6, n). - N. J. A. Sloane, Jun 12 2004
a(n) = a(n-1) + Sum_{k=1..floor(n/2)} a(n-2*k). - Floor van Lamoen, Oct 29 2005
a(n) = 5*a(n-2) - 6*a(n-4) + a(n-6). - Floor van Lamoen, Nov 02 2005
a(n) = A006053(n+2) - A006053(n). - R. J. Mathar, Nov 16 2007
a(2*n) = A052975(n), a(2*n+1) = A060557(n). - Johannes W. Meijer, May 29 2010
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x))))). - Michael Somos, Apr 05 2012
a(-1 - n) = A052534(n). - Michael Somos, Apr 05 2012
a(n) = (2^n/7)*Sum_{r=1..6} (1-(-1)^r)*cos(Pi*r/7)^n*(1+cos(Pi*r/7)). - Herbert Kociemba, Sep 15 2020

Extensions

More terms from James Sellers, Jun 05 2000

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

Original entry on oeis.org

1, 0, 2, 1, 5, 5, 14, 19, 42, 66, 131, 221, 417, 728, 1341, 2380, 4334, 7753, 14041, 25213, 45542, 81927, 147798, 266110, 479779, 864201, 1557649, 2806272, 5057369, 9112264, 16420730, 29587889, 53317085, 96072133, 173118414, 311945595, 562110290, 1012883066
Offset: 0

Views

Author

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

Keywords

Comments

Form the graph with matrix A=[0,1,1;1,0,0;1,0,1] (P_3 with a loop at an extremity). Then A052547 counts closed walks of length n at the degree 2 vertex. - Paul Barry, Oct 02 2004
The characteristic polynomial x^3 - x^2 - 2*x + 1 generates a 3 step recursion: a(0)=1,a(1)=0,a(2)=2, for n>2 a(n)=a(n-1)+2*a(n-2)-a(n-3) so we can also prepend the term 1,0 to a(n) and get the same sequence, i.e. start with a(0)=1,a(1)=0,a(2)=1. - Lambert Klasen (lambert.klasen(AT)gmx.net), Jan 30 2005
The length of the diagonals (including the side) of a regular 7-gon (heptagon) inscribed in a circle of radius r=1 are d_1=2*sin(Pi/7) (the side length), d_2=2*cos(Pi/7)*d_1, and d_3=2*sin(3*Pi/7). The two ratios are rho := R_2 = d_2/d_1 = 2*cos(Pi/7) approximately 1.801937736, and sigma:= R_3 = d_3/d_1 = S(2,rho) = rho^2-1, approximately 2.246979604. See A049310 for Chebyshev S-polynomials. See the Steinbach reference where the basis <1,rho,sigma> has been considered for an extension of the rational field Q, which is there called Q(rho). This rho is the largest zero of S(6,x). For nonnegative powers of rho one has rho^n = C(n)*1 + B(n)*rho + A(n)*sigma, with B(n)=a(n-1), a(-1):=0, a(-2):=1, A(n)=B(n+1)-B(n-1)= A006053(n), and C(n)=B(n-1)=a(n-2), n>=0. For negative powers see A106803 and -A006054. For nonnegative and negative powers of sigma see A006054, A106803 and a(n), -A006053, respectively.
a(n) appears also in the formula for the nonpositive powers of sigma (see the comment above for the definition and the Steinbach basis) as sigma^(-n) = a(n)*1 - A006053(n+1)*rho - a(n-1)*sigma, n>=0. Put a(-1):=0. 1/sigma=sigma-rho, the smallest positive zero of S(6,x) (see A049310 for Chebyshev S-polynomials). - Wolfdieter Lang, Dec 01 2010

Crossrefs

Cf. A096976; second differences of A028495 and first differences of A006053 (up to an offset).

Programs

  • GAP
    a:=[1,0,2];; for n in [4..40] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 08 2019
  • Magma
    I:=[1,0,2]; [n le 3 select I[n] else Self(n-1) + 2*Self(n-2) - Self(n-3): n in [1..40]]; // G. C. Greubel, May 08 2019
    
  • Maple
    spec := [S,{S=Sequence(Prod(Z,Union(Z,Prod(Z, Sequence(Z)))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..40);
  • Mathematica
    LinearRecurrence[{1, 2, -1}, {1, 0, 2}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 13 2012 *)
  • PARI
    {a(n) = if(n==0,1,if(n==1,0,if(n==2,2,a(n-1)+2*a(n-2)-a(n-3))))};
    for(i=0,40,print1(a(i),",")) \\ Lambert Klasen, Jan 30 2005
    
  • Sage
    ((1-x)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 08 2019
    

Formula

a(n) = a(n-1) + 2*a(n-2) - a(n-3), with a(0)=1, a(1)=0, a(2)=2.
a(n) = Sum(-1/7*_alpha*(-3+_alpha)*_alpha^(-1-n), _alpha=RootOf(_Z^3-2*_Z^2-_Z+1)).
a(n) = 5*a(n-2) - 6*a(n-4) + a(n-6). - Floor van Lamoen, Nov 02 2005

Extensions

More terms from James Sellers, Jun 05 2000

A080937 Number of Catalan paths (nonnegative, starting and ending at 0, step +/-1) of 2*n steps with all values <= 5.

Original entry on oeis.org

1, 1, 2, 5, 14, 42, 131, 417, 1341, 4334, 14041, 45542, 147798, 479779, 1557649, 5057369, 16420730, 53317085, 173118414, 562110290, 1825158051, 5926246929, 19242396629, 62479659622, 202870165265, 658715265222, 2138834994142, 6944753544643, 22549473023585
Offset: 0

Views

Author

Henry Bottomley, Feb 25 2003

Keywords

Comments

With interpolated zeros (1,0,1,0,2,...), counts closed walks of length n at start or end node of P_6. The sequence (0,1,0,2,...) counts walks of length n between the start and second node. - Paul Barry, Jan 26 2005
HANKEL transform of sequence and the sequence omitting a(0) is the sequence A130716. This is the unique sequence with that property. - Michael Somos, May 04 2012
From Wolfdieter Lang, Mar 30 2020: (Start)
a(n) is also the upper left entry of the n-th power of the 3 X 3 tridiagonal matrix M_3 = Matrix([1,1,0], [1,2,1], [0,1,2]) from A332602: a(n) = ((M_3)^n)[1,1].
Proof: (M_3)^n = b(n-2)*(M_3)^2 - (6*b(n-3) - b(n-4))*M_3 + b(n-3)*1_3, for n >= 0, with b(n) = A005021(n), for n >= -4. For the proof of this see a comment in A005021. Hence (M_3)^n[1,1] = 2*b(n-2) - 5*b(n-3) + b(n-4), for n >= 0. This proves the 3 X 3 part of the conjecture in A332602 by Gary W. Adamson.
The formula for a(n) given below in terms of r = rho(7) = A160389 proves that a(n)/a(n-1) converges to rho(7)^2 = A116425 = 3.2469796..., because r - 2/r = 0.6920... < 1, and r^2 - 3 = 0.2469... < 1. This limit was conjectured in A332602 by Gary W. Adamson.
(End)

Examples

			G.f. = 1 + x + 2*x^2 + 5*x^3 + 14*x^4 + 42*x^5 + 131*x^6 + 417*x^7 + 1341*x^8 + ...
		

Crossrefs

Cf. A033191 which essentially provide the same sequence for different limits and tend to A000108.

Programs

  • Magma
    I:=[1,1,2]; [n le 3 select I[n] else 5*Self(n-1)-6*Self(n-2)+Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jan 09 2016
  • Maple
    a:= n-> (<<0|1|0>, <0|0|1>, <1|-6|5>>^n. <<1, 1, 2>>)[1, 1]:
    seq(a(n), n=0..35);  # Alois P. Heinz, Nov 09 2012
  • Mathematica
    nn=56;Select[CoefficientList[Series[(1-4x^2+3x^4)/(1-5x^2+6x^4-x^6), {x,0,nn}], x],#>0 &] (* Geoffrey Critzer, Jan 26 2014 *)
    LinearRecurrence[{5,-6,1},{1,1,2},30] (* Jean-François Alcover, Jan 09 2016 *)
  • PARI
    a=vector(99); a[1]=1; a[2]=2;a[3]=5; for(n=4,#a,a[n]=5*a[n-1]-6*a[n-2] +a[n-3]); a \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    {a(n) = if( n<0, n = -n; polcoeff( (1 - 3*x + x^2) / (1 - 6*x + 5*x^2 - x^3) + x * O(x^n), n), polcoeff( (1 - 4*x + 3*x^2) / (1 - 5*x + 6*x^2 - x^3) + x * O(x^n), n))} /* Michael Somos, May 04 2012 */
    

Formula

a(n) = A080934(n,5).
G.f.: (1-4*x+3*x^2)/(1-5*x+6*x^2-x^3). - Ralf Stephan, May 13 2003
a(n) = 5*a(n-1) - 6*a(n-2) + a(n-3). - Herbert Kociemba, Jun 11 2004
a(n) = A096976(2*n). - Floor van Lamoen, Nov 02 2005
a(n) = (4/7-4/7*cos(1/7*Pi)^2)*(4*(cos(Pi/7))^2)^n + (1/7-2/7*cos(1/7*Pi) + 4/7*cos(1/7*Pi)^2)*(4*(cos(2*Pi/7))^2)^n + (2/7+2/7*cos(1/7*Pi))*(4*(cos(3*Pi/7))^2)^n for n>=0. - Richard Choulet, Apr 19 2010
G.f.: 1 / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x))))). - Michael Somos, May 04 2012
a(-n) = A038213(n). a(n + 2) * a(n) - a(n + 1)^2 = a(1 - n). Convolution inverse is A123183 with A123183(0)=1. - Michael Somos, May 04 2012
From Wolfdieter Lang, Mar 30 2020: (Start)
In terms of the algebraic number r = rho(7) = A160389 of degree 3 the formula given by Richard Choulet becomes a(n) = (1/7)*(r)^(2*n)*(C1(r) + C2(r)*(r - 2/r)^(2*n) + C3(r)*(r^2 - 3)^(2*n)), with C1(r) = 4 - r^2, C2(r) = 1 - r + r^2, and C3 = 2 + r.
a(n) = ((M_3)^n)[1,1] = 2*b(n-2) - 5*b(n-3) + b(n-4), for n >= 0, with the 3 X 3 tridiagonal matrix M_3 = Matrix([1,1,0], [1,2,1], [0,1,2]) from A332602, and b(n) = A005021(n) (with offset n >= -4). (End)

A096975 Trace sequence of a path graph plus loop.

Original entry on oeis.org

3, 1, 5, 4, 13, 16, 38, 57, 117, 193, 370, 639, 1186, 2094, 3827, 6829, 12389, 22220, 40169, 72220, 130338, 234609, 423065, 761945, 1373466, 2474291, 4459278, 8034394, 14478659, 26088169, 47011093, 84708772, 152642789, 275049240
Offset: 0

Views

Author

Paul Barry, Jul 16 2004

Keywords

Comments

Let A be the adjacency matrix of the graph P_3 with a loop added at the end. Then a(n) = trace(A^n). A is a 'reverse Jordan matrix' [0,0,1;0,1,1;1,1,0]. a(n) = abs(A094648(n)).
From L. Edson Jeffery, Mar 22 2011: (Start)
Let A be the unit-primitive matrix (see [Jeffery])
A = A_(7,1) =
(0 1 0)
(1 0 1)
(0 1 1).
Then a(n) = Trace(A^n). (End)

Crossrefs

A033304(n) = a(-1-n). - Michael Somos, Aug 03 2006

Programs

  • Mathematica
    CoefficientList[Series[(3 - 2 x - 2 x^2)/(1 - x - 2 x^2 + x^3), {x, 0, 33}], x] (* Michael De Vlieger, Aug 21 2019 *)
  • PARI
    {a(n)=if(n>=0, n+=1; polsym(x^3-x^2-2*x+1,n-1)[n], n=1-n; polsym(1-x-2*x^2+x^3,n-1)[n])} /* Michael Somos, Aug 03 2006 */
    
  • PARI
    a(n)=trace([0,1,0;1,0,1;0,1,1]^n); /* Joerg Arndt, Apr 30 2011 */

Formula

G.f.: (3-2*x-2*x^2)/(1-x-2*x^2+x^3);
a(n) = a(n-1) + 2*a(n-2) - a(n-3);
a(n) = (2*sqrt(7)*sin(atan(sqrt(3)/9)/3)/3+1/3)^n + (1/3-2*sqrt(7)*sin(atan(sqrt(3)/9)/3+Pi/3)/3)^n + (2*sqrt(7)*cos(acot(-sqrt(3)/9)/3)/3+1/3)^n.
a(n) = 2^n*((cos(Pi/7))^n+(cos(3*Pi/7))^n+(cos(5*Pi/7))^n). - Vladimir Shevelev, Aug 25 2010
a(n) = (-1)^n*A094648(n). - R. J. Mathar, Nov 05 2024

A187065 Let i be in {1,2,3} and let r >= 0 be an integer. Let p = {p_1, p_2, p_3} = {-2,0,1}, n=2*r+p_i, and define a(-2)=1. Then, a(n)=a(2*r+p_i) gives the quantity of H_(7,1,0) tiles in a subdivided H_(7,i,r) tile after linear scaling by the factor x^r, where x=sqrt(2*cos(Pi/7)).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 1, 1, 3, 5, 4, 5, 9, 14, 14, 19, 28, 42, 47, 66, 89, 131, 155, 221, 286, 417, 507, 728, 924, 1341, 1652, 2380, 2993, 4334, 5373, 7753, 9707, 14041, 17460, 25213, 31501, 45542, 56714, 81927, 102256, 147798, 184183, 266110, 331981, 479779
Offset: 0

Views

Author

L. Edson Jeffery, Mar 09 2011

Keywords

Comments

(Start) See A187067 for supporting theory. Define the matrix
U_1= (0 1 0)
(1 0 1)
(0 1 1).
Let r>=0 and M=(m_(i,j))=(U_1)^r, i,j=1,2,3. Let A_r be the r-th "block" defined by A_r={a(2*r-2),a(2*r),a(2*r+1)} with a(-2)=1. Note that A_r-A_(r-1)-2*A_(r-2)+A_(r-3)={0,0,0}, with A_0={a(-2),a(0),a(1)}={1,0,0}. Let p={p_1,p_2,p_3}=(-2,0,1) and n=2*r+p_i. Then a(n)=a(2*r+p_i)=m_(i,1), where M=(m_(i,j))=(U_1)^r was defined above. Hence the block A_r corresponds component-wise to the first column of M, and a(n)=m_(i,1) gives the quantity of H_(7,1,0) tiles that should appear in a subdivided H_(7,i,r) tile. (End)
Combining blocks A_r, B_r and C_r, from this sequence, A187066 and A187067, respectively, as matrix columns [A_r,B_r,C_r] generates the matrix (U_1)^r, and a negative index (-1)*r yields the corresponding inverse [A_(-r),B_(-r),C_(-r)]=(U_1)^(-r) of (U_1)^r. Therefore, the three sequences need not be causal.
Since a(2*r-2)=a(2*(r-1)) for all r, this sequence arises by concatenation of first-column entries m_(2,1) and m_(3,1) from successive matrices M=(U_1)^r.
a(n+2)=A187067(n), a(2*n)=A096976(n+1), a(2*n+1)=A006053(n).

Examples

			Suppose r=3. Then
A_r = A_3 = {a(2*r-2),a(2*r),a(2*r+1)} = {a(4),a(6),a(7)} = {0,2,1},
corresponding to the entries in the first column of
  M = (U_2)^3 = (0 2 1)
                (2 1 3)
                (1 3 3).
Choose i=2 and set n=2*r+p_i. Then a(n) = a(2*r+p_i) = a(6+0) = a(6) = 2, which equals the entry in row 2 and column 1 of M. Hence a subdivided H_(7,2,3) tile should contain a(6) = m_(2,1) = 2 H_(7,1,0) tiles.
		

Crossrefs

Programs

  • Magma
    I:=[0,0,1,0,0,1]; [n le 6 select I[n] else Self(n-2)+2*Self(n-4)-Self(n-6): n in [1..60]]; // Vincenzo Librandi, Sep 18 2015
    
  • Mathematica
    LinearRecurrence[{0,1,0,2,0,-1},{0,0,1,0,0,1},50] (* Harvey P. Dale, Aug 15 2012 *)
    CoefficientList[Series[x^2 (1 - x^2 + x^3)/(1 - x^2 - 2 x^4 + x^6), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 18 2015 *)
  • PARI
    my(x='x+O('x^50)); concat([0,0], Vec(x^2*(1-x^2+x^3)/(1-x^2-2*x^4 +x^6))) \\ G. C. Greubel, Jan 29 2018

Formula

Recurrence: a(n) = a(n-2) + 2*a(n-4) - a(n-6).
G.f.: x^2*(1-x^2+x^3)/(1-x^2-2*x^4+x^6).
Closed-form: a(n) = -(1/14)*((X_1 + Y_1*(-1)^(n-1))*((w_2)^2 - (w_3)^2)*(w_1)^(n-1) + (X_2 + Y_2*(-1)^(n-1))*((w_3)^2 - (w_1)^2)*(w_2)^(n-1) + (X_3 + Y_3*(-1)^(n-1))*((w_1)^2 - (w_2)^2)*(w_3)^(n-1)), where w_k = sqrt(2*(-1)^(k-1)*cos(k*Pi/7)), X_k = (w_k)^3 - w_k + 1 and Y_k = -(w_k)^3 + w_k + 1, k=1,2,3.

Extensions

More terms from Vincenzo Librandi, Sep 18 2015

A216054 Square array T, read by antidiagonals: T(n,k) = 0 if n-k >= 1 or if k-n >= 6, T(0,0) = T(0,1) = T(0,2) = T(0,3) = T(0,4) = T(0,5) = 1, T(n,k) = T(n-1,k) + T(n,k-1).

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 3, 2, 0, 0, 1, 4, 5, 0, 0, 0, 0, 5, 9, 5, 0, 0, 0, 0, 5, 14, 14, 0, 0, 0, 0, 0, 0, 19, 28, 14, 0, 0, 0, 0, 0, 0, 19, 47, 42, 0, 0, 0, 0, 0, 0, 0, 0, 66, 89, 42, 0, 0, 0, 0, 0, 0, 0, 0, 66, 155, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 286, 131, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Mar 16 2013

Keywords

Comments

A hexagon arithmetic of E. Lucas.

Examples

			Square array begins:
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... row n=0
0, 1, 2, 3, 4, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... row n=1
0, 0, 2, 5, 9, 14, 19, 19, 0, 0, 0, 0, 0, 0, 0, ... row n=2
0, 0, 0, 5, 14, 28, 47, 66, 66, 0, 0, 0, 0, 0, 0, ... row n=3
0, 0, 0, 0, 14, 42, 89, 155, 221, 221, 0, 0, 0, 0, ... row n=4
0, 0, 0, 0, 0, 0, 42, 131, 286, 507, 728, 728, 0, 0, ... row n=5
0, 0, 0, 0, 0, 0, 131, 417, 924, 1652, 2380, 2380, 0, ... row n=6
...
		

References

  • E. Lucas, Théorie des nombres, A.Blanchard, Paris, 1958, Tome 1, p.89

Crossrefs

Cf. Similar sequences A216230, A216228, A216226, A216238

Programs

  • Mathematica
    Clear[t]; t[0, k_ /; k <= 5] = 1; t[n_, k_] /; k < n || k > n+5 = 0; t[n_, k_] := t[n, k] = t[n-1, k] + t[n, k-1]; Table[t[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Mar 18 2013 *)

Formula

T(n,n) = A080937(n).
T(n,n+1) = A080937(n+1).
T(n,n+2) = A094790(n+1).
T(n,n+3) = A094789(n+1).
T(n,n4) = T(n,n+5) = A005021(n).
Sum_{k, 0<=k<=n} T(n-k,k) = A028495(n).
Showing 1-8 of 8 results.