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-4 of 4 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

A187066 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)=0. Then, a(n)=a(2*r+p_i) gives the quantity of H_(7,2,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

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
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 B_r be the r-th "block" defined by B_r={a(2*r-2),a(2*r),a(2*r+1)} with a(-2)=0. Note that B_r-B_(r-1)-2*B_(r-2)+B_(r-3)={0,0,0}, with B_0={a(-2),a(0),a(1)}={0,1,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,2), where M=(m_(i,j))=(U_1)^r was defined above. Hence the block B_r corresponds component-wise to the second column of M, and a(n)=m_(i,2) gives the quantity of H_(7,2,0) tiles that should appear in a subdivided H_(7,i,r) tile. (End)
Combining blocks A_r, B_r and C_r, from A187065, this sequence 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 second-column entries m_(2,2) and m_(3,2) from successive matrices M=(U_1)^r.

Examples

			Suppose r=3. Then
B_r = B_3 = {a(2*r-2),a(2*r),a(2*r+1)}={a(4),a(6),a(7)} = {2,1,3},
corresponding to the entries in the third 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) = 1, which equals the entry in row 2 and column 2 of M. Hence a subdivided H_(7,2,3) tile should contain a(6) = m_(2,2) = 1 H_(7,2,0) tiles.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,1,0,2,0,-1},{1,0,0,1,2,1},50] (* Harvey P. Dale, Aug 16 2012 *)
    CoefficientList[Series[(1 - x^2 + x^3)/(1 - x^2 - 2*x^4 + x^6), {x, 0, 50}], x] (* G. C. Greubel, Oct 20 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec((1-x^2+x^3)/(1-x^2-2*x^4+x^6)) \\ G. C. Greubel, Oct 20 2017

Formula

Recurrence: a(n) = a(n-2)+2*a(n-4)-a(n-6).
a(2*n) = A052547(n), a(2n+1) = A006053(n+1).
G.f.: (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)^5-(w_k)^3+(w_k)^2 and Y_k = -(w_k)^5+(w_k)^3+(w_k)^2, k=1,2,3.

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

A188107 Triangle T(n,k) with the coefficient [x^k] of 1/(1 - x - 2*x^2 + x^3)^(n-k+1) in row n, column k.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 7, 4, 1, 4, 12, 14, 9, 1, 5, 18, 31, 35, 14, 1, 6, 25, 56, 87, 70, 28, 1, 7, 33, 90, 175, 207, 154, 47, 1, 8, 42, 134, 310, 476, 504, 306, 89, 1, 9, 52, 189, 504, 941, 1274, 1137, 633, 155, 1, 10, 63, 256, 770, 1680, 2745, 3188, 2571
Offset: 0

Views

Author

L. Edson Jeffery, Mar 20 2011

Keywords

Comments

Modified versions of the generating function for the diagonal, A006053, are related to rhombus substitution tilings (see A187065, A187066 and A187067).

Examples

			The triangle starts in row n=0 as
  1;
  1,   1;
  1,   2,   3;
  1,   3,   7,   4;
  1,   4,  12,  14,   9;
  1,   5,  18,  31,  35,  14;
  1,   6,  25,  56,  87,  70,  28;
  1,   7,  33,  90, 175, 207, 154,  47;
  1,   8,  42, 134, 310, 476, 504, 306,  89;
		

Crossrefs

Programs

  • Maple
    A188107 := proc(n,k) 1/(1-x-2*x^2+x^3)^(n-k+1) ; coeftayl(%,x=0,k) ; end proc:
    seq(seq(A188107(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Mar 22 2011

Formula

Sum_{k=0..n} T(n,k) = A001654(n+1).
T(n,k) = T(n-1,k) + T(n-1,k-1) + 2*T(n-2,k-2) - T(n-3,k-3). - Philippe Deléham, Feb 24 2012
Showing 1-4 of 4 results.