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

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

Original entry on oeis.org

2, 6, 11, 26, 57, 129, 289, 650, 1460, 3281, 7372, 16565, 37221, 83635, 187926, 422266, 948823, 2131986, 4790529, 10764221, 24186985, 54347662, 122118088, 274396853, 616564132, 1385407029, 3112981337, 6994805571, 15717185450
Offset: 0

Views

Author

Keywords

Comments

From L. Edson Jeffery, Mar 22 2011: (Start)
Let A be the unit-primitive matrix (see [Jeffery])
A=A_(7,2)=
(0 0 1)
(0 1 1)
(1 1 1).
Let B={b(n)} be this sequence shifted to the right one place and setting b(0)=3. Then B=(3,2,6,11,26,...) with generating function (3-4*x-x^2)/(1-2*x-x^2+x^3) and b(n)=Trace(A^n). (End)
The following identity hold true (a(n)^2 - a(2n+2))/2 = A094648(n+1) = (-1)^(n+1)*A096975(n+1) - for the proof see Witula et al.'s papers - Roman Witula, Jul 25 2012
We note that the joined sequences (-1)^(n+1)*a(n) and A094648(n) form a two-sided sequence defined either by the recurrence formula x(n+3) + x(n+2) - 2x(n+1) - x(n) = 0, n in Z, x(0)=3, x(-1)=-2, x(1)=-1, or by the following trigonometric identities: x(n) = (c(1))^n + (c(2))^n + (c(4))^n = (c(1)c(2))^(-n) + (c(1)c(4))^(-n) + (c(2)c(4))^(-n) = (s(2)/s(1))^n + (s(4)/s(2))^n + (s(1)/s(4))^n, for n in Z, where c(j) := 2*cos(2Pi*j/7) and s(j) := sin(2*Pi*j/7) - for the proof see Witula's and Witula et al.'s papers. - Roman Witula, Jul 25 2012
We have 4*a(n+2) - a(n) = 7*A077998(n+2). - Roman Witula, Aug 13 2012
Two very intriguing identities of trigonometric nature hold: (-1)^n*(a(n)-a(n-1)) = c(1)*c(2)^(-n) + c(2)*c(4)^(-n) + c(4)*c(1)^(-n), and (-1)^(n+1)*(a(n-1)-a(n+1)) = c(1)*c(4)^(-n-1) + c(2)*c(1)^(-n-1) + c(4)*c(2)^(-n-1), where a(-1):=3 and c(j) is defined as above. For the proof see Remark 6 in the first Witula's paper. - Roman Witula, Aug 14 2012
With respect to the form of the trigonometric formulas describing a(n), we call this sequence the Berndt-type sequence number 20 for the argument 2Pi/7. The A-numbers of other Berndt-type sequences numbers are given in below. - Roman Witula, Sep 30 2012

References

  • R. P. Stanley, Enumerative Combinatorics I, p. 244, Eq. (36).

Crossrefs

Programs

  • Magma
    I:=[2,6,11]; [n le 3 select I[n] else 2*Self(n-1) +Self(n-2) - Self(n-3): n in [1..30]]; // G. C. Greubel, Apr 19 2018
  • Mathematica
    CoefficientList[Series[(2+2x-3x^2)/(1-2x-x^2+x^3),{x,0,50}], x]  (* Harvey P. Dale, Mar 14 2011 *)
    LinearRecurrence[{2, 1, -1}, {2, 6, 11}, 29] (* Jean-François Alcover, Sep 27 2017 *)
  • PARI
    {a(n)=if(n<0, n=-n; polsym(x^3-x^2-2*x+1,n-1)[n], n+=2; polsym(1-x-2*x^2+x^3,n-1)[n])} /* Michael Somos, Aug 03 2006 */
    
  • PARI
    x='x+O('x^99); Vec((2+2*x-3*x^2)/(1-2*x-x^2+x^3)) \\ Altug Alkan, Apr 19 2018
    

Formula

a(-1-n) = A096975(n).
a(n) = (1-2*cos(1/7*Pi))^(n+1)+(1+2*cos(2/7*Pi))^(n+1)+(1-2*cos(3/7*Pi))^(n+1). - Vladeta Jovovic, Jun 27 2001
a(n) = trace of (n+1)-th power of the 3 X 3 matrix (in the example of A066170): [1 1 1 / 1 1 0 / 1 0 0]. Alternatively, the sum of the (n+1)st powers of the roots of the corresponding characteristic polynomial: x^3 - 2*x^2 - x + 1 = 0. a(n) = A006356(n) + A006356(n-1) + 2*A006356(n-2). E.g., a(3) = 26 = the trace of M^4. The characteristic polynomial of this matrix (see A066170) is x^3 - 2*x^2 - x + 1 and the roots are 2.24697960372..., -0.8019377358... and 0.55495813208... = a, b, c. Then Sum(a^4 + b^4 + c^4) = 26. - Gary W. Adamson, Feb 01 2004
(-1)^(n+1)*a(n) = (c(1))^(-n-1) + (c(2))^(-n-1) + (c(3))^(-n-1) = (c(1)c(2))^(n+1) + (c(1)c(4))^(n+1) + (c(2)c(4))^(n+1) = (s(1)/s(2))^(n+1) + (s(2)/s(4))^(n+1) + (s(4)/s(1))^(n+1), where c(j) := 2*cos(2*Pi*j/7) and s(j) := sin(2*Pi*j/7) - for the proof see Witula's and Witula et al.'s papers. - Roman Witula, Jul 25 2012
a(n) = 3*A077998(n+1) - A006054(n+2) - A006054(n+1). - Roman Witula, Aug 13 2012
a(n)*(-1)^(n+1) = (A094648(n+1)^2 - A094648(2*(n+1)))/2. - Roman Witula, Sep 30 2012

A274975 Sum of n-th powers of the three roots of x^3-2*x^2-x+1.

Original entry on oeis.org

3, 2, 6, 11, 26, 57, 129, 289, 650, 1460, 3281, 7372, 16565, 37221, 83635, 187926, 422266, 948823, 2131986, 4790529, 10764221, 24186985, 54347662, 122118088, 274396853, 616564132, 1385407029, 3112981337, 6994805571, 15717185450, 35316195134, 79354770147, 178308549978
Offset: 0

Views

Author

Kai Wang, Jul 14 2016

Keywords

Comments

a(n) is x1^n + x2^n + x3^n, where x1, x2, x3 are the roots of the polynomial x^3-2*x^2-x+1.
x1 = 1/(2*cos(Pi/7)),
x2 = 1/(-2*cos(2*Pi/7)),
x3 = 1/(-2*cos(4*Pi/7)).

Crossrefs

Cf. A096975.
3 followed by terms of A033304.

Programs

  • Mathematica
    CoefficientList[Series[-(x^2 + 4 x - 3)/(x^3 - x^2 - 2 x + 1), {x, 0, 32}], x] (* Michael De Vlieger, Jul 14 2016 *)
  • PARI
    Vec(-(x^2+4*x-3)/(x^3-x^2-2*x+1) + O(x^50)) \\ Colin Barker, Aug 02 2016

Formula

G.f.: -(x^2+4*x-3)/(x^3-x^2-2*x+1). - Alois P. Heinz, Jul 14 2016
a(0)=3, a(1)=2, a(2)=6; thereafter a(n)=2*a(n-1)+a(n-2)-a(n-3).
a(n) = (2*cos(Pi/7))^(-n) + (-2*cos(2*Pi/7))^(-n) + (-2*cos(4*Pi/7))^(-n).
a(n) = A033304(n-1) for n>0.

A218664 Coefficients of cubic polynomials p(x+n), where p(x) = x^3 + x^2 - 2*x - 1.

Original entry on oeis.org

1, 1, -2, -1, 1, 4, 3, -1, 1, 7, 14, 7, 1, 10, 31, 29, 1, 13, 54, 71, 1, 16, 83, 139, 1, 19, 118, 239, 1, 22, 159, 377, 1, 25, 206, 559, 1, 28, 259, 791, 1, 31, 318, 1079, 1, 34, 383, 1429, 1, 37, 454, 1847, 1, 40, 531, 2339, 1, 43, 614, 2911, 1, 46, 703, 3569, 1, 49, 798, 4319
Offset: 0

Views

Author

Roman Witula, Nov 04 2012

Keywords

Comments

We have p(x) = (x - c(1))*(x - c(2))*(x - c(4)), where c(j) := 2*cos(2*Pi*j/7). We note that c(4) = c(3) = -c(1/2), c(1) = s(3) and c(2) = -s(1), where s(j) := 2*sin(Pi*j/14). Moreover we obtain -p(-x) = x^3 - x^2 - 2*x + 1 = (x + c(1))*(x + c(2))*(x + c(4)), q(x) := -x^3*p(1/x) = x^3 + 2*x^2 + x - 1 = (x - c(1)^(-1))*(x - c(2)^(-1))*(x - c(4)^(-1)), and -q(-x) = x^3 - 2*x^2 + x + 1 = (x + c(1)^(-1))*(x + c(2)^(-1))*(x + c(4)^(-1)).
We also have p(x+2) = x^3 + 7*x^2 + 14*x + 7 = (x + s(2)^2)*(x + s(4)^2)*(x + s(6)^2). The polynomial -p(-x-2) = x^3 - 7*x^2 + 14*x - 7 = (x - s(2)^2)*(x - s(4)^2)*(x - s(6)^2) is known as Johannes Kepler's cubic polynomial (see Witula's book).
Let us set r(x) := p(x+1). It can be verified that -x^3*r(1/x) = x^3 - 3*x^2 - 4*x - 1 = (x - c(1)/c(4))*(x - c(4)/c(2))*(x - c(2)/c(1)); for example, we have c(1)^3 + c(1)^2 - 2*c(1) - 1 = 0 which implies that c(1)^2 + 2*c(1) = 1/(c(1) - 1), and then c(1)^2 + 2*c(1) = c(4)/c(2) since c(4)/c(2) = (c(1)^4 - 4*c(1)^2 + 2)/(c(1)^2 - 2).
The polynomials p(x+n) and the ones obtained as above (i.e., after simple algebraic transformations) are the characteristic polynomials of many sequences in the OEIS; see crossrefs.

References

  • R. Witula, Complex Numbers, Polynomials and Partial Fraction Decomposition, Part 3, Wydawnictwo Politechniki Slaskiej, Gliwice 2010 (Silesian Technical University publishers).

Crossrefs

Formula

We have a(4*k) = 1, a(4*k + 1) = 3*k + 1, a(4*k + 2) = 3*k^2 + 2*k - 2, a(4*k + 3) = k^3 + k^2 - 2*k - 1. Further, the following relations hold true: b(k+1) = b(k) + 3, c(k+1) = 2*b(k) -2*c(k) + 3, d(k+1) = b(k) - 2*c(k) - d(k) + 1, where p(x + k) = x^3 + b(k)*x^2 + c(k)*x + d(k).
Empirical g.f.: -(x^15 - x^14 - 2*x^13 + x^12 - 5*x^11 + 10*x^10 + 3*x^9 - 3*x^8 - 3*x^7 - 11*x^6 + 3*x^4 + x^3 + 2*x^2 - x - 1) / ((x-1)^4*(x+1)^4*(x^2+1)^4). - Colin Barker, May 17 2013

A376498 Array read by ascending antidiagonals: A(n, k) = 2^k*Sum_{j=1..n} cos((2*j - 1)*Pi/(2*n + 1))^k.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 1, 1, 0, 4, 1, 3, 1, 0, 5, 1, 5, 4, 1, 0, 6, 1, 7, 4, 7, 1, 0, 7, 1, 9, 4, 13, 11, 1, 0, 8, 1, 11, 4, 19, 16, 18, 1, 0, 9, 1, 13, 4, 25, 16, 38, 29, 1, 0, 10, 1, 15, 4, 31, 16, 58, 57, 47, 1, 0, 11, 1, 17, 4, 37, 16, 78, 64, 117, 76, 1, 0
Offset: 0

Views

Author

Cheng-Jun Li, Sep 25 2024

Keywords

Comments

It is only a conjecture that the A(n, k) are always integers.

Examples

			Array starts:
[0] 0, 0,  0, 0,  0,  0,   0,  0,   0,   0,    0,    0, ...  [A000004]
[1] 1, 1,  1, 1,  1,  1,   1,  1,   1,   1,    1,    1, ...  [A000012]
[2] 2, 1,  3, 4,  7, 11,  18, 29,  47,  76,  123,  199, ...  [A000032]
[3] 3, 1,  5, 4, 13, 16,  38, 57, 117, 193,  370,  639, ...  [A096975]
[4] 4, 1,  7, 4, 19, 16,  58, 64, 187, 247,  622,  925, ...  [A094649]
[5] 5, 1,  9, 4, 25, 16,  78, 64, 257, 256,  874, 1013, ...  [A189234]
[6] 6, 1, 11, 4, 31, 16,  98, 64, 327, 256, 1126, 1024, ...  [A216605]
[7] 7, 1, 13, 4, 37, 16, 118, 64, 397, 256, 1378, 1024, ...
[8] 8, 1, 15, 4, 43, 16, 138, 64, 467, 256, 1630, 1024, ...
[9] 9, 1, 17, 4, 49, 16, 158, 64, 537, 256, 1882, 1024, ...
		

Crossrefs

Rows: A000004 (n=0), A000012 (n=1), A000032 (n=2), A096975 (n=3), A094649 (n=4), A189234 (n=5), A216605 (n=6, with alternate signs).
Columns: A001477 (k=0), A057427 (k=1).
Cf. A180870.

Programs

  • PARI
    A(n, k) = 2^k*sum(j=1, n, (cos((2*j-1)*Pi/(2*n+1)))^k, x=0)

Formula

A(n + k, 2*k - 1) = A(k, 2*k-1) = 4^(k-1).
Let P_n(x) be the polynomial: Sum_{k=0..n} x^k*A180870(n, k). Let R_n(x) be the polynomial Product_{k=0..n} x-Roots(P_n, k)^m. A(n, k) = abs([x^1] R_n(x))/2^(m*(n-1)), for n > 0. - Thomas Scheuerle, Oct 07 2024
Showing 1-5 of 5 results.