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.

A002249 a(n) = a(n-1) - 2*a(n-2) with a(0) = 2, a(1) = 1.

Original entry on oeis.org

2, 1, -3, -5, 1, 11, 9, -13, -31, -5, 57, 67, -47, -181, -87, 275, 449, -101, -999, -797, 1201, 2795, 393, -5197, -5983, 4411, 16377, 7555, -25199, -40309, 10089, 90707, 70529, -110885, -251943, -30173, 473713, 534059, -413367, -1481485
Offset: 0

Views

Author

Keywords

Comments

4*2^n = A002249(n)^2 + 7*A001607(n)^2. See A077020, A077021.
Among presented initial elements of the sequence a(n), the maximal increasing or decreasing subsequences have length either 3 or 4. - Roman Witula, Aug 21 2012
This is the Lucas Sequence V_n(P, Q) = V_n(1, 2). U_n(1, 2) = A107920(n). - Raphie Frank, Dec 25 2013
The only numbers that occur more than once are 1=a(1)=a(4) and -5=a(3)=a(9). See Noam D. Elkies's posting in the Mathematics Stack Exchange link. - Robert Israel, Dec 21 2016

Examples

			We have a(2)-a(7) = a(5)-a(4) = a(6)+a(4) = a(11)-a(10) = a(12)+a(10)=10. Further the following relations: ((1+i*sqrt(7))/2)^4 + ((1-i*sqrt(7))/2)^4 = 1 and ((1+i*sqrt(7))/2)^8 + ((1-i*sqrt(7))/2)^8 = -31. - _Roman Witula_, Aug 21 2012
G.f. = 2 + x - 3*x^2 - 5*x^3 + x^4 + 11*x^5 + 9*x^6 - 13*x^7 - 31*x^8 + ...
From _Raphie Frank_, Dec 05 2015: (Start)
V_n(1, 2) = a(1*n) = ((a(1) + sqrt(-7))/2)^n + ((a(1) - sqrt(-7))/2)^n; a(1) = 1.
V_n(-3, 4) = a(2*n) = ((a(2) + sqrt(-7))/2)^n + ((a(2) - sqrt(-7))/2)^n; a(2) = -3.
V_n(-5, 8) = a(3*n) = ((a(3) + sqrt(-7))/2)^n + ((a(3) - sqrt(-7))/2)^n; a(3) = -5.
V_n(11, 32) = a(5*n) = ((a(5) + sqrt(-7))/2)^n + ((a(5) - sqrt(-7))/2)^n; a(5) = 11.
V_n(-181, 8192) = a(13*n) = ((a(13) + sqrt(-7))/2)^n + ((a(13) - sqrt(-7))/2)^n; a(13) = -181.
(End)
		

Crossrefs

Programs

  • Magma
    I:=[2,1]; [n le 2 select I[n] else Self(n-1)-2*Self(n-2): n in [1..50]]; // Vincenzo Librandi, Nov 29 2015
    
  • Maple
    A002249 := proc(n) option remember; >if n = 1 then 1 elif n = 2 then -3 else A002249(n-1>)-2*A002249(n-2); fi; end;
  • Mathematica
    LinearRecurrence[{1,-2}, {2,1}, 50] (* Roman Witula, Aug 21 2012 *)
    a[ n_] := 2^(n/2) ChebyshevT[ n, 8^(-1/2)] 2; (* Michael Somos, Jun 02 2014 *)
    a[ n_] := 2^Min[0, n] SeriesCoefficient[ (2 - x) / (1 - x + 2 x^2), {x, 0, Abs @ n}]; (* Michael Somos, Jun 02 2014 *)
    Table[2 Re[((1 + I Sqrt[7])/2)^n], {n, 0, 40}] (* Jean-François Alcover, Jun 02 2017 *)
  • PARI
    {a(n) = if( n<0, 2^n * a(-n), polsym(2 - x + x^2, n)[n+1])}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    {a(n) = 2 * real( ((1 + quadgen(-28)) / 2)^n )}; /* Michael Somos, Jun 02 2014 */
    
  • PARI
    x='x+O('x^100); Vec((2-x)/(1-x+2*x^2)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import sqrt, re, I
    def a(n): return 2*re(((1 + I*sqrt(7))/2)**n)
    print([a(n) for n in range(40)]) # Indranil Ghosh, Jun 02 2017
  • Sage
    [lucas_number2(n,1,2) for n in range(0, 40)] # Zerinvary Lajos, Apr 30 2009
    

Formula

G.f.: (2-x)/(1-x+2x^2). - Michael Somos, Oct 18 2002
a(n) = trace(A^n) for the square matrix A=[1, -2; 1, 0]. - Paul Barry, Sep 05 2003
a(n) = 2^((n+2)/2)*cos(-n*acot(sqrt(7)/7)). - Paul Barry, Sep 06 2003
a(n) = (-1)^n*(2*A110512(n) - A001607(n)) = ((1 + i*sqrt(7))/2)^n + ((1 - i*sqrt(7))/2)^n. - Roman Witula, Aug 21 2012
G.f.: G(0), where G(k) = 1 + 1/(1 - x*(7*k+1)/(x*(7*k+8) + 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 03 2013
(a(A060728(n) - 2))^2 = (A107920(2*(A060728(n)) - 4))^2 = 2^(A060728(n)) - 7 = A227078(n), the Ramanujan-Nagell squares. - Raphie Frank, Dec 25 2013
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x - 7*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = (A107920(n+1) + 2*A107920(n+2) - A107920(n+3))/2. - Raphie Frank, Nov 28 2015
V_n(P,Q) = a(k*n) = ((a(k) + sqrt(-7))/2)^n + ((a(k) - sqrt(-7))/2)^n for k is in {1, 2, 3, 5, 13} = (A060728(n) - 2), P is in {1, -3, -5, 11, -181} = a(k), and Q is in {2, 4, 8, 32, 8192} = 2^k = (2*A076046(n) + 2) = (A227078(n) - 7)/4. P^2 - 4*Q = -7. - Raphie Frank, Dec 05 2015
From Peter Bala, Nov 16 2022: (Start)
The Gauss congruences hold: a(n*p^k) == a(n*p^(k-1)) (mod p^k) for all positive integers n and k and all primes p.
A268924(n) == a(3^n) (mod 3^n). (End)

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

Original entry on oeis.org

1, 1, 1, 5, 9, 13, 33, 69, 121, 253, 529, 1013, 2025, 4141, 8193, 16293, 32857, 65629, 130801, 262229, 524745, 1047949, 2096865, 4195845, 8387641, 16775101, 33558481, 67109045, 134209449, 268443373, 536879553, 1073717349, 2147490841, 4295009053, 8589878449
Offset: 0

Views

Author

Paul Barry, Nov 18 2003

Keywords

Comments

Row sums of the Riordan array (1,x(1+4x^2)). - Paul Barry, Jan 12 2006
6*a(n-3) is the number of distinct nonbacktracking paths of length n on a unit cube which start on a given vertex and end on the same one (if n is even) or the opposite one (if n is odd). E.g., a(7)=69 because a(7)=a(6)+4*a(4)=33+4*9=69. a(3)=5 because there are 6*a(6-3)=6*5=30 nonbacktracking paths of length 6 on a unit cube that end on the same vertex (6 is even); if we name the vertices of a unit cube ABCDEFGH in the order of x+2y+4z, such paths starting from A are ABDCGEA, ABDHFBA, ABDHFEA, ABDHGCA, ABDHGDA; the remaining 25 can be derived from these 5 reflecting them about the ABGH plane and rotating the resulting 10 around the AH axis by 120 and -120 degrees. - Michal Kaczmarczyk, Apr 24 2006
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=3, 5*a(n-3) equals the number of 5-colored compositions of n with all parts >=3, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
a(n+2) equals the number of words of length n on alphabet {0,1,2,3,4}, having at least two zeros between every two successive nonzero letters. - Milan Janjic, Feb 07 2015
Number of compositions of n into one sort of part 1 and four sorts of part 3 (the g.f. is 1/(1-x-4*x^3) ). - Joerg Arndt, Feb 07 2015

Crossrefs

Programs

  • Maple
    seq(add(binomial(n-2*k,k)*4^k,k=0..floor(n/3)),n=0..32); # Zerinvary Lajos, Apr 03 2007
  • Mathematica
    Table[HypergeometricPFQ[{1/3-n/3,2/3-n/3,-n/3},{1/2-n/2,-n/2},-27],{n,0,32}] (* Peter Luschny, Feb 07 2015 *)
    CoefficientList[Series[1/((1 - 2*x)*(1 + x + 2*x^2)), {x,0,50}], x] (* G. C. Greubel, Apr 27 2017 *)
    LinearRecurrence[{1,0,4},{1,1,1},40] (* Harvey P. Dale, Sep 01 2021 *)
  • PARI
    Vec(1/((1-2*x)*(1+x+2*x^2)) + O(x^50)) \\ Michel Marcus, Feb 07 2015

Formula

a(n) = Sum_{k=0..floor(n/2)} C(n-2*k, k)*4^k.
a(n) = 2^(n-1)+2^(n/2)*(cos((n+2)*arctan(sqrt(7)/7)+Pi*n/2)/4+5*sqrt(7)*sin((n+2)*arctan(sqrt(7)/7)+Pi*n/2)/28).
a(n) = Sum_{k=0..n} C(k, floor((n-k)/2))2^(n-k)*(1+(-1)^(n-k))/2. - Paul Barry, Jan 12 2006
a(n) = a(n-1) + 4*a(n-3) for n>=3, a(0)=1, a(1)=1, a(2)=1. - Michal Kaczmarczyk, Apr 24 2006
a(n) = 2^(n-1) + A110512(n)/2. - R. J. Mathar, Aug 23 2011
G.f.: Q(0)/2, where Q(k) = 1 + 1/(1 - x*(4*k+1 + 4*x^2)/( x*(4*k+3 + 4*x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
a(n) = hypergeom([1/3-n/3,2/3-n/3,-n/3],[1/2-n/2,-n/2],-27). - Peter Luschny, Feb 07 2015

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

Original entry on oeis.org

1, 0, -3, 3, 6, -15, -3, 48, -39, -105, 222, 93, -759, 480, 1797, -3237, -2154, 11865, -5403, -30192, 46401, 44175, -183378, 50853, 499281, -651840, -846003, 2801523, -263514, -8141055, 8931597, 15491568, -42286359, -4188345, 131047422, -118482387, -274659879, 630107040, 193872597
Offset: 0

Views

Author

Paul Barry, Jul 24 2005

Keywords

Comments

Row sums of number triangle A110522.
The sequence a(n) is conjugate with A214733 since the following alternative relations: either ((-1 + i*sqrt(11))/2)^n = a(n) + A214733(n)*(-1 + i*sqrt(11))/2 or ((-1 - i*sqrt(11))/2)^n = a(n) + A214733(n)*(-1 - i*sqrt(11))/2. We have a(n+1) = -3*A214733(n), A214733(n+1) = a(n) - A214733(n). We note that sequences A110512 and A001607 are conjugated in a similar way. The above relations are connected with the Gauss sums, for example if e := exp(i*2Pi/11) then e + e^3 + e^4 + e^5 + e^9 = (-1 + i*sqrt(11))/2, and e^2 + e^6 + e^7 + e^8 + e^10 = (-1 - i*sqrt(11))/2, which is equivalent to the system of sums: Sum_{k=1..5} cos(2Pi*k/11) = -1/2 and Sum_{k=1..5} sin(2Pi*k/11) = sqrt(11)/2, and which is equivalent to the system of products: P_{k=1..5} cos(2Pi*k/11) = -1/32 and P_{k=1..5} sin(2Pi*k/11) = sqrt(11)/32 - for details see Witula's book. Lastly we note that ((-1 + i*sqrt(11))/2)^n + ((-1 - i*sqrt(11))/2)^n = 2*a(n) - A214733(n). - Roman Witula, Jul 27 2012

References

  • Roman Witula, On Some Applications of Formulae for Unimodular Complex Numbers, Jacek Skalmierski's Press, Gliwice 2011.

Crossrefs

Programs

  • Magma
    [n le 2 select 2-n else -(Self(n-1) +3*Self(n-2)): n in [1..50]]; // G. C. Greubel, Dec 28 2023
    
  • Mathematica
    CoefficientList[Series[(1+x)/(1+x+3*x^2), {x,0,50}], x] (* G. C. Greubel, Aug 30 2017 *)
    LinearRecurrence[{-1,-3},{1,0},40] (* Harvey P. Dale, Jul 02 2022 *)
  • PARI
    my(x='x+O('x^50)); Vec((1+x)/(1+x+3*x^2)) \\ G. C. Greubel, Aug 30 2017
    
  • SageMath
    @CachedFunction # a = A110523
    def a(n): return 1-n if n<2 else -a(n-1) -3*a(n-2)
    [a(n) for n in range(41)] # G. C. Greubel, Dec 28 2023

Formula

a(n) = Sum_{k=0..n} Sum_{j=0..n} (-1)^(n-j)*C(n, j)*(-3)^(j-k)*C(k, j-k).
From Roman Witula, Jul 27 2012: (Start)
a(n+2) + a(n+1) + 3*a(n) = 0.
a(n+1) = (-1)^n*(3*i*sqrt(11)/11)*(((1 + i*sqrt(11))/2)^(n-1) - ((1 - i*sqrt(11))/2)^(n-1)). (End)
From G. C. Greubel, Dec 28 2023: (Start)
a(n) = (-1)^n*3^((n-1)/2)*( sqrt(3)*ChebyshevU(n, 1/(2*sqrt(3))) - ChebyshevU(n-1, 1/(2*sqrt(3))) ).
a(n) = A106852(n) - A106852(n-1).
a(n) = (-1)^n*( A214733(n+1) + A214733(n) ). (End)
E.g.f.: exp(-x/2)*(sqrt(11)*cos(sqrt(11)*x/2) + sin(sqrt(11)*x/2))/sqrt(11). - Stefano Spezia, Jul 27 2025

A110511 Riordan array (1/(1+x), x(1-x)/(1+x)^2).

Original entry on oeis.org

1, -1, 1, 1, -4, 1, -1, 9, -7, 1, 1, -16, 26, -10, 1, -1, 25, -70, 52, -13, 1, 1, -36, 155, -190, 87, -16, 1, -1, 49, -301, 553, -403, 131, -19, 1, 1, -64, 532, -1372, 1462, -736, 184, -22, 1, -1, 81, -876, 3024, -4446, 3206, -1216, 246, -25, 1, 1, -100, 1365, -6084, 11826, -11584, 6190, -1870, 317, -28, 1, -1, 121, -2035
Offset: 0

Views

Author

Paul Barry, Jul 24 2005

Keywords

Comments

Inverse of number triangle A110506. Row sums are A110512. Diagonal sums are A110513. Product of (1/(1+x), x/(1+x)) (inverse binomial transform matrix) and (1, x(1-2x)) (A110509).

Examples

			Rows begin
   1;
  -1,   1;
   1,  -4,   1;
  -1,   9,  -7,   1;
   1, -16,  26, -10,   1;
  -1,  25, -70,  52, -13,   1;
		

Programs

  • Mathematica
    T[n_, k_] := Sum[(-1)^(n - j)*Binomial[n, j]*(-2)^(j - k)*Binomial[k, j - k], {j, 0, n}]; Table[T[n, k], {n, 0, 20}, {k, 0, n}] // Flatten (* G. C. Greubel, Aug 29 2017 *)
  • PARI
    for(n=0,20, for(k=0,n, print1(sum(j=0,n, (-1)^(n-j)*binomial(n, j)*(-2)^(j-k)*binomial(k, j-k)), ", "))) \\ G. C. Greubel, Aug 29 2017

Formula

Number triangle: T(n, k) = Sum_{j=0..n} (-1)^(n-j)*C(n, j)*(-2)^(j-k)*C(k, j-k).
T(n, k) = Sum_{j=0..n} Sum_{i=0..k} C(k, i)*C(n+k-i-j-1, n-k-i-j)*(-1)^(n-k).
T(n,k) = T(n-1,k-1) - 2*T(n-1,k) - T(n-2,k) - T(n-2,k-1), T(0,0)=1, T(1,0)=-1, T(1,1)=1, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Jan 12 2014

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

Original entry on oeis.org

0, 0, 2, 2, 2, 10, 18, 26, 66, 138, 242, 506, 1058, 2026, 4050, 8282, 16386, 32586, 65714, 131258, 261602, 524458, 1049490, 2095898, 4193730, 8391690, 16775282, 33550202, 67116962, 134218090, 268418898, 536886746, 1073759106, 2147434698, 4294981682, 8590018106
Offset: 0

Views

Author

Benoit Cloitre, Oct 24 2006

Keywords

Comments

See lemma 5.2 of Reznick's preprint.
Conjecture: count of even Markov numbers in generation n (with generations 0, 1 and 2 labeled as {5}, {13, 29} and {34, 194, 433, 169}. (Checked up to generation 20.) - Wouter Meeussen, Jan 16 2024
Wouter Meeussen's conjecture is true. Proof: label the Markov tree with Markov triples according to the scheme described at A368546. Mod 2, the triples are: row 0: (1,1,0); row 1: (1,1,1), (1,1,0); row 2: (1,0,1), (1,0,1), (1,1,1), (1,1,0); row 3: (1,1,0), (0,1,1), (1,1,0), (0,1,1), (1,0,1), (1,0,1), (1,1,1), (1,1,0); etc. Note that the Markov number labels of the tree (the center numbers of the triples) in rows 0 and 1 include no even numbers, while those in row 2 include two even numbers. Observing that the second triple in row 1 and the first four triples in row 3 are the same or the reverse of the root triple, and noting that every vertex in row 3 and beyond is in a subtree with one of these triples as root, the recurrence follows. - William P. Orrick, Mar 05 2024

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,0,4},{0,0,2},36] (* James C. McMahon, Jan 16 2024 *)
  • PARI
    a0=a1=0;a2=2;for(n=3,50,a3=a2+4*a0;a0=a1;a1=a2;a2=a3;print1(a3,","))

Formula

a(n) = (1/7)*2^(-2 + n/2)*(7*2^(n/2) - 7*cos(n*(Pi - arctan(sqrt(7)))) + 5*sqrt(7)*sin(n*(-Pi + arctan(sqrt(7))))). - Zak Seidov, Oct 26 2006
G.f.: 2*x^2 / ((1-2*x)*(2*x^2+x+1)). - Colin Barker, Jun 20 2013
a(n) = 2 * A089977(n-2) for n >= 2. - Alois P. Heinz, Jan 16 2024
From A.H.M. Smeets, Jan 16 2024: (Start)
Limit_{n -> oo} a(n)/a(n-1) = 2.
a(n) = 2^(n-2) + A110512(n-2), for n >= 2. (End)

Extensions

Entries checked by Zak Seidov, Oct 26 2006
Showing 1-5 of 5 results.