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.

A057079 Periodic sequence: repeat [1,2,1,-1,-2,-1]; expansion of (1+x)/(1-x+x^2).

Original entry on oeis.org

1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1
Offset: 0

Views

Author

Wolfdieter Lang, Aug 04 2000

Keywords

Comments

Inverse binomial transform of A057083. Binomial transform of A061347. The sums of consecutive pairs of elements give A084103. - Paul Barry, May 15 2003
Hexaperiodic sequence identical to its third differences. - Paul Curtz, Dec 13 2007
a(n+1) is the Hankel transform of A001700(n+1)-A001700(n). - Paul Barry, Apr 21 2009
Non-simple continued fraction expansion of 1 = 1+1/(2+1/(1+1/(-1+...))). - R. J. Mathar, Mar 08 2012
Pisano period lengths: 1, 3, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, ... - R. J. Mathar, Aug 10 2012
Alternating row sums of Riordan triangle A111125. - Wolfdieter Lang, Oct 18 2012
Periodic sequences of this type can be also calculated by a(n) = c + floor(q/(p^m-1)*p^n) mod p, where c is a constant, q is the number representing the periodic digit pattern and m is the period length. c, p and q can be calculated as follows: Let D be the array representing the number pattern to be repeated, m = size of D, max = maximum value of elements in D, min = minimum value of elements in D. Than c := min, p := max - min + 1 and q := p^m*sum_{i=1..m} (D(i)-min)/p^i. Example: D = (1, 2, 1, -1, -2, -1), c = -2, m = 6, p = 5 and q = 12276 for this sequence. - Hieronymus Fischer, Jan 04 2013

Examples

			G.f. = 1 + 2*x + x^2 - x^3 - 2*x^4 - x^5 + x^6 + 2*x^7 + x^8 - x^9 - 2*x^10 + x^11 + ...
		

Crossrefs

Cf. A049310. Apart from signs, same as A061347.

Programs

  • Maple
    A057079:=n->[1, 2, 1, -1, -2, -1][(n mod 6)+1]: seq(A057079(n), n=0..100); # Wesley Ivan Hurt, Mar 10 2015
  • Mathematica
    a[n_] := {1, 2, 1, -1, -2, -1}[[Mod[n, 6] + 1]]; Array[a, 100, 0] (* Jean-François Alcover, Jul 05 2013 *)
    CoefficientList[Series[(1 + x)/(1 - x + x^2), {x, 0, 71}], x] (* Michael De Vlieger, Jul 10 2017 *)
    PadRight[{},100,{1,2,1,-1,-2,-1}] (* Harvey P. Dale, Nov 11 2024 *)
  • PARI
    {a(n) = [1, 2, 1, -1, -2, -1][n%6 + 1]}; /* Michael Somos, Jul 14 2006 */
    
  • PARI
    {a(n) = if( n<0, n = 2-n); polcoeff( (1 + x) / (1 - x + x^2) + x * O(x^n), n)}; /* Michael Somos, Jul 14 2006 */
    
  • PARI
    a(n)=2^(n%3%2)*(-1)^(n\3) \\ Tani Akinari, Aug 15 2013

Formula

a(n) = S(n, 1) + S(n-1, 1) = S(2*n, sqrt(3)); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind, A049310. S(n, 1) = A010892(n).
a(n) = 2*cos((n-1)*Pi/3) = a(n-1) - a(n-2) = -a(n-3) = a(n-6) = (A022003(n+1)+1)*(-1)^floor(n/3). Unsigned a(n) = 4 - a(n-1) - a(n-2). - Henry Bottomley, Mar 29 2001
a(n) = (-1)^floor(n/3) + ((-1)^floor((n-1)/3) + (-1)^floor((n+1)/3))/2. - Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003
a(n) = (1/2 - sqrt(3)*i/2)^(n-1) + (1/2 + sqrt(3)*i/2)^(n-1) = cos(Pi*n/3) + sqrt(3)*sin(Pi*n/3). - Paul Barry, Mar 15 2004
The period 3 sequence (2, -1, -1, ...) has a(n) = 2*cos(2*Pi*n/3) = (-1/2 - sqrt(3)*i/2)^n + (-1/2 + sqrt(3)*i/2)^n. - Paul Barry, Mar 15 2004
Euler transform of length 6 sequence [2, -2, -1, 0, 0, 1]. - Michael Somos, Jul 14 2006
G.f.: (1 + x) / (1 - x + x^2) = (1 - x^2)^2 * (1 - x^3) / ((1 - x)^2 * (1 - x^6)). a(n) = a(2-n) for all n in Z. - Michael Somos, Jul 14 2006
a(n) = A033999(A002264(n))*(A000035(A010872(n))+1). - Hieronymus Fischer, Jun 20 2007
a(n) = (3*A033999(A002264(n)) - A033999(n))/2. - Hieronymus Fischer, Jun 20 2007
a(n) = (-1)^floor(n/3)*((n mod 3) mod 2 + 1). - Hieronymus Fischer, Jun 20 2007
a(n) = (3*(-1)^floor(n/3) - (-1)^n)/2. - Hieronymus Fischer, Jun 20 2007
a(n) = (-1)^((n-1)/3) + (-1)^((1-n)/3). - Jaume Oliver Lafont, May 13 2010
E.g.f.: E(x) = S(0), S(k) = 1 + 2*x/(6*k+1 - x*(6*k+1)/(4*(3*k+1) + x + 4*x*(3*k+1)/(6*k + 3 - x - x*(6*k+3)/(3*k + 2 + x - x*(3*k+2)/(12*k + 10 + x - x*(12*k+10)/(x - (6*k+6)/S(k+1))))))); (continued fraction). - Sergei N. Gladkovskii, Dec 14 2011
a(n) = -2 + floor((281/819)*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013
a(n) = -2 + floor((11/14)*5^(n+1)) mod 5. - Hieronymus Fischer, Jan 04 2013
a(n) = A010892(n) + A010892(n-1).
a(n) = ( (1+i*sqrt(3))^(n-1) + (1-i*sqrt(3))^(n-1) )/2^(n-1), where i=sqrt(-1). - Bruno Berselli, Dec 01 2014
a(n) = 2*sin((2n+1)*Pi/6). - Wesley Ivan Hurt, Apr 04 2015
a(n) = hypergeom([-n/2-2, -n/2-5/2], [-n-4], 4). - Peter Luschny, Dec 17 2016
G.f.: 1 / (1 - 2*x / (1 + 3*x / (2 - x))). - Michael Somos, Dec 29 2016
a(n) = (2*n+1)*(Sum_{k=0..n} ((-1)^k/(2*k+1))*binomial(n+k,2*k)) for n >= 0. - Werner Schulte, Jul 10 2017
Sum_{n>=0} (a(n)/(2*n+1))*x^(2*n+1) = arctan(x/(1-x^2)) for -1 < x < 1. - Werner Schulte, Jul 10 2017
E.g.f.: exp(x/2)*(sqrt(3)*cos(sqrt(3)*x/2) + 3*sin(sqrt(3)*x/2))/sqrt(3). - Stefano Spezia, Aug 04 2025

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

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 3, 4, 1, 0, 4, 10, 6, 1, 0, 5, 20, 21, 8, 1, 0, 6, 35, 56, 36, 10, 1, 0, 7, 56, 126, 120, 55, 12, 1, 0, 8, 84, 252, 330, 220, 78, 14, 1, 0, 9, 120, 462, 792, 715, 364, 105, 16, 1, 0, 10, 165, 792, 1716, 2002, 1365, 560, 136, 18, 1
Offset: 0

Views

Author

Philippe Deléham, Apr 22 2007

Keywords

Comments

Triangle T(n,k), 0 <= k <= n, read by rows given by [0,2,-1/2,1/2,0,0,0,0,0,...] DELTA [1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.
Row sums give A088305. - Philippe Deléham, Nov 21 2007
Column k is C(n,2k-1) for k > 0. - Philippe Deléham, Jan 20 2012
From R. Bagula's comment in A053122 (cf. Damianou link p. 10), this array gives the coefficients (mod sign) of the characteristic polynomials for the Cartan matrix of the root system A_n. - Tom Copeland, Oct 11 2014
T is the convolution triangle of the positive integers (see A357368). - Peter Luschny, Oct 19 2022

Examples

			The triangle T(n,k) begins:
   n\k  0    1    2    3    4    5    6    7    8    9   10
   0:   1
   1:   0    1
   2:   0    2    1
   3:   0    3    4    1
   4:   0    4   10    6    1
   5:   0    5   20   21    8    1
   6:   0    6   35   56   36   10    1
   7:   0    7   56  126  120   55   12    1
   8:   0    8   84  252  330  220   78   14    1
   9:   0    9  120  462  792  715  364  105   16    1
  10:   0   10  165  792 1716 2002 1365  560  136   18    1
  ... reformatted by _Wolfdieter Lang_, Jul 31 2017
From _Peter Luschny_, Mar 06 2022: (Start)
The sequence can also be seen as a square array read by upwards antidiagonals.
   1, 1,   1,    1,    1,     1,     1,      1,      1, ...  A000012
   0, 2,   4,    6,    8,    10,    12,     14,     16, ...  A005843
   0, 3,  10,   21,   36,    55,    78,    105,    136, ...  A014105
   0, 4,  20,   56,  120,   220,   364,    560,    816, ...  A002492
   0, 5,  35,  126,  330,   715,  1365,   2380,   3876, ... (A053126)
   0, 6,  56,  252,  792,  2002,  4368,   8568,  15504, ... (A053127)
   0, 7,  84,  462, 1716,  5005, 12376,  27132,  54264, ... (A053128)
   0, 8, 120,  792, 3432, 11440, 31824,  77520, 170544, ... (A053129)
   0, 9, 165, 1287, 6435, 24310, 75582, 203490, 490314, ... (A053130)
    A27,A292, A389, A580,  A582, A1288, A10966, A10968, A165817       (End)
		

Crossrefs

Cf. A165817 (the main diagonal of the array).

Programs

  • Maple
    # Computing the rows of the array representation:
    S := proc(n,k) option remember;
    if n = k then 1 elif k < 0 or k > n then 0 else
    S(n-1, k-1) + 2*S(n-1, k) - S(n-2, k) fi end:
    Arow := (n, len) -> seq(S(n+k-1, k-1), k = 0..len-1):
    for n from 0 to 8 do Arow(n, 9) od; # Peter Luschny, Mar 06 2022
    # Uses function PMatrix from A357368.
    PMatrix(10, n -> n); # Peter Luschny, Oct 19 2022
  • Mathematica
    With[{nmax = 10}, CoefficientList[CoefficientList[Series[(1 - x)^2/(1 - (2 + y)*x + x^2), {x, 0, nmax}, {y, 0, nmax}], x], y]] // Flatten (* G. C. Greubel, Nov 22 2017 *)
  • PARI
    for(n=0,10, for(k=0,n, print1(if(n==0 && k==0, 1, if(k==0, 0, binomial(n+k-1,2*k-1))), ", "))) \\ G. C. Greubel, Nov 22 2017
    
  • Python
    from functools import cache
    @cache
    def A128908(n, k):
        if n == k: return 1
        if (k <= 0 or k > n): return 0
        return A128908(n-1, k-1) + 2*A128908(n-1, k) - A128908(n-2, k)
    for n in range(10):
        print([A128908(n, k) for k in range(n+1)]) # Peter Luschny, Mar 07 2022
  • Sage
    @cached_function
    def T(k,n):
        if k==n: return 1
        if k==0: return 0
        return sum(i*T(k-1,n-i) for i in (1..n-k+1))
    A128908 = lambda n,k: T(k,n)
    for n in (0..10): print([A128908(n,k) for k in (0..n)]) # Peter Luschny, Mar 12 2016
    

Formula

T(n,0) = 0^n, T(n,k) = binomial(n+k-1, 2k-1) for k >= 1.
Sum_{k=0..n} T(n,k)*2^(n-k) = A002450(n) = (4^n-1)/3 for n>=1. - Philippe Deléham, Oct 19 2008
G.f.: (1-x)^2/(1-(2+y)*x+x^2). - Philippe Deléham, Jan 20 2012
Sum_{k=0..n} T(n,k)*x^k = (-1)^n*A001352(n), (-1)^(n+1)*A054888(n+1), (-1)^n*A008574(n), (-1)^n*A084103(n), (-1)^n*A084099(n), A163810(n), A000007(n), A088305(n) for x = -6, -5, -4, -3, -2, -1, 0, 1 respectively. - Philippe Deléham, Jan 20 2012
Riordan array (1, x/(1-x)^2). - Philippe Deléham, Jan 20 2012

A267633 Expansion of (1 - 4t)/(1 - x + t x^2): a Fibonacci-type sequence of polynomials.

Original entry on oeis.org

1, -4, 1, -4, 1, -5, 4, 1, -6, 8, 1, -7, 13, -4, 1, -8, 19, -12, 1, -9, 26, -25, 4, 1, -10, 34, -44, 16, 1, -11, 43, -70, 41, -4, 1, -12, 53, -104, 85, -20, 1, -13, 64, -147, 155, -61, 4, 1, -14, 76, -200, 259, -146, 24
Offset: 0

Views

Author

Tom Copeland, Jan 18 2016

Keywords

Examples

			Row polynomials:
P(0,t) = 1 - 4t
P(1,t) = 1 - 4t = [-t(0) + (1-4t)] = -t(0) + P(0,t)
P(2,t) = 1 - 5t + 4t^2 = [-t(1-4t) + (1-4t)] = -t P(0,t) + P(1,t)
P(3,t) = 1 - 6t + 8t^2 = [-t(1-4t) + (1-5t+4t^2)] = -t P(1,t) + P(2,t)
P(4,t) = 1 - 7t + 13t^2 - 4t^3 = [-t(1-5t+4t^2) + (1-6t+8t^2)]
P(5,t) = 1 - 8t + 19t^2 - 12t^3 = [-t(1-6t+8t^2) + (1-7t+13t^2)]
P(6,t) = 1 - 9t + 26t^2 - 25t^3 + 4t^4
P(7,t) = 1 - 10t + 34t^2 - 44t^3 + 16t^4
P(8,t) = 1 - 11t + 43t^2 - 70t^3 + 41t^4 - 4t^5
P(9,t) = 1 - 12t + 53t^2 - 104t^3 + 85t^4 - 20t^5
P(10,t) = 1 - 13t + 64t^2 - 147t^3 + 155t^4 - 61t^5 + 4t^6
P(11,t) = 1 - 14t + 76t^2 - 200t^3 + 259t^4 - 146t^5 + 24t^6
...
Apparently: The odd rows for n>1 are reversed rows of A140882 (mod signs), and the even rows for n>0, the 9th, 15th, 21st, 27th, etc. rows of A228785 (mod signs). The diagonals are reverse rows of A202241.
		

Crossrefs

Programs

  • Mathematica
    p = (1 - 4 t) / (1 - x + t x^2) + O[x]^12 // CoefficientList[#, x] &;
    CoefficientList[#, t] & /@ p // Flatten (* Andrey Zabolotskiy, Mar 07 2024 *)

Formula

O.g.f. G(x,t) = (1 - 4t)/(1 - x + t x^2) = a / [t (x - (1+sqrt(a))/(2t))(x - (1-sqrt(a))/(2t))] with a = 1-4t.
Recursion P(n,t) = -t P(n-2,t) + P(n-1,t) with P(-1,t)=0 and P(0,t) = 1-4t.
Convolution of the Fibonacci polynomials of signed A011973 Fb(n,-t) with coefficients of (1-4t), e.g., (1-4t)Fb(5,-t) = (1-4t)(1-3t+t^2) = 1-7t+13t^2-4t^3, so, for n>=1 and k<=(n-1), T(n,k) = (-1)^k [-4*binomial(n-(k-1),k-1) - binomial(n-k,k)] with the convention that 1/(-m)! = 0 for m>=1, i.e., let binomial(n,k) = nint[n!/((k+c)!(n-k+c)!)] for c sufficiently small in magnitude.
Third column is A034856, and the fourth, A000297. Embedded in the coefficients of the highest order term of the polynomials is A008586 (cf. also A008574).
With P(0,t)=0, the o.g.f. is H(x,t) = (1-4t) x(1-tx)/[1-x(1-tx)] = (1-4t) Linv(Cinv(tx)/t), where Linv(x) = x/(1-x) with inverse L(x) = x/(1+x) and Cinv(x) = x (1-x) is the inverse of the o.g.f. of the shifted Catalan numbers A000108, C(x) = [1-sqrt(1-4x)]/2. Then Hinv(x,t) = C[t L(x/(1-4t))]/t = {1 - sqrt[1-4t(x/(1-4t))/[1+x/(1-4t)]]}/2t = {1-sqrt[1-4tx/(1-4t+x)]}/2t = 1/(1-4t) + (-1+t)/(1-4t)^2 x + (1-2t+2t^2)/(1-4t)^3 x^ + (-1+3t-6t^2+5t^3)/(1-4t)^4 + ..., where the numerators are the signed polynomials of A098474, reverse of A124644.
Row sums (t=1) are periodic -3,-3,0,3,3,0, repeat the six terms ... with o.g.f. -3 - 3x (1-x) / [1-x(1-x)]. Cf. A084103.
Unsigned row sums (t=-1) are shifted A022088 with o.g.f. 5 + 5x(1+x) / [x(1+x)].

Extensions

Data corrected by Andrey Zabolotskiy, Mar 07 2024

A330451 a(n) = a(n-3) + 20*n - 30 for n > 2, with a(0)=0, a(1)=3, a(2)=13.

Original entry on oeis.org

0, 3, 13, 30, 53, 83, 120, 163, 213, 270, 333, 403, 480, 563, 653, 750, 853, 963, 1080, 1203, 1333, 1470, 1613, 1763, 1920, 2083, 2253, 2430, 2613, 2803, 3000, 3203, 3413, 3630, 3853, 4083, 4320, 4563, 4813, 5070
Offset: 0

Views

Author

Paul Curtz, Mar 01 2020

Keywords

Comments

Main N-S vertical in the pentagonal spiral for A002264:
16
16 10 10
16 9 5 5 10
15 9 4 1 2 5 11
15 9 4 1 0 0 2 6 11
15 8 4 1 0 2 6 11
14 8 3 3 3 6 12
14 8 7 7 7 12
14 13 13 13 12
The main S-N vertical is A194275.

Crossrefs

Cf. A049347.

Programs

  • Mathematica
    Table[2/9(-1+15n^2+Cos[2n*Pi/3]),{n,0,39}] (* Stefano Spezia, Mar 02 2020 *)
  • PARI
    concat(0, Vec(x*(1 + x)*(3 + 4*x + 3*x^2) / ((1 - x)^3*(1 + x + x^2)) + O(x^40))) \\ Colin Barker, Mar 02 2020
    
  • Python
    def A330451(n): return 10*n**2//3 # Chai Wah Wu, Aug 12 2025

Formula

G.f.: x*(1 + x)*(3 + 4*x + 3*x^2) / ((1 - x)^3*(1 + x + x^2)). - Colin Barker, Mar 02 2020
a(n) = a(-n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
a(n) = (2/9)*(-1 + 15*n^2 + cos(2*n*Pi/3)). - Stefano Spezia, Mar 02 2020
a(3*n) = 30*n^2.
a(n) = floor(10*n^2/3). - Chai Wah Wu, Aug 12 2025

A084104 A period 6 sequence.

Original entry on oeis.org

1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7
Offset: 0

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Partial sums of A084103.

Crossrefs

Programs

  • PARI
    {a(n)=[1, 4, 7, 7, 4, 1][n%6+1]}
    
  • PARI
    a(n)=2*sqrt(3)*sin((n+5)*Pi/3)+4 \\ Jaume Oliver Lafont, Aug 27 2009

Formula

Euler transform of length 6 sequence [ 4, -3, -1, 0, 0, 1]. - Michael Somos, Nov 07 2006
G.f.: (1+x)^3/((1-x)(1+x^3)).
G.f.:(1+x)^2/((1-x)*(1-x+x^2)). - Jaume Oliver Lafont, Aug 27 2009
Showing 1-5 of 5 results.