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-7 of 7 results.

A028242 Follow n+1 by n. Also (essentially) Molien series of 2-dimensional quaternion group Q_8.

Original entry on oeis.org

1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38
Offset: 0

Views

Author

Keywords

Comments

A two-way infinite sequences which is palindromic (up to sign). - Michael Somos, Mar 21 2003
Number of permutations of [n+1] avoiding the patterns 123, 132 and 231 and having exactly one fixed point. Example: a(0) because we have 1; a(2)=2 because we have 213 and 321; a(3)=1 because we have 3214. - Emeric Deutsch, Nov 17 2005
The ring of invariants for the standard action of Quaternions on C^2 is generated by x^4 + y^4, x^2 * y^2, and x * y * (x^4 - y^4). - Michael Somos, Mar 14 2011
A000027 and A001477 interleaved. - Omar E. Pol, Feb 06 2012
First differences are A168361, extended by an initial -1. (Or: a(n)-a(n-1) = A168361(n+1), for all n >= 1.) - M. F. Hasler, Oct 05 2017
Also the number of unlabeled simple graphs with n + 1 vertices and exactly n endpoints (vertices of degree 1). The labeled version is A327370. - Gus Wiseman, Sep 06 2019

Examples

			G.f. = 1 + 2*x^2 + x^3 + 3*x^4 + 2*x^5 + 4*x^6 + 3*x^7 + 5*x^8 + 4*x^9 + 6*x^10 + 5*x^11 + ...
Molien g.f. = 1 + 2*t^4 + t^6 + 3*t^8 + 2*t^10 + 4*t^12 + 3*t^14 + 5*t^16 + 4*t^18 + 6*t^20 + ...
		

References

  • D. Benson, Polynomial Invariants of Finite Groups, Cambridge, p. 23.
  • S. Mukai, An Introduction to Invariants and Moduli, Cambridge, 2003; see p. 15.
  • M. D. Neusel and L. Smith, Invariant Theory of Finite Groups, Amer. Math. Soc., 2002; see p. 97.
  • L. Smith, Polynomial Invariants of Finite Groups, A K Peters, 1995, p. 90.

Crossrefs

Cf. A000124 (a=1, a=n+a), A028242 (a=1, a=n-a).
Partial sums give A004652. A030451(n)=a(n+1), n>0.
Cf. A052938 (same sequence except no leading 1,0,2).
Column k = n - 1 of A327371.

Programs

  • GAP
    a:=[1];; for n in [2..80] do a[n]:=(n-1)-a[n-1]; od; a; # Muniru A Asiru, Dec 16 2018
    
  • Haskell
    import Data.List (transpose)
    a028242 n = n' + 1 - m where (n',m) = divMod n 2
    a028242_list = concat $ transpose [a000027_list, a001477_list]
    -- Reinhard Zumkeller, Nov 27 2012
    
  • Magma
    &cat[ [n+1, n]: n in [0..37] ]; // Klaus Brockhaus, Nov 23 2009
    
  • Maple
    series((1+x^3)/(1-x^2)^2,x,80);
    A028242:=n->floor((n+1+(-1)^n)/2): seq(A028242(n), n=0..100); # Wesley Ivan Hurt, Mar 17 2015
  • Mathematica
    Table[(1 + 2 n + 3 (-1)^n)/4, {n, 0, 74}] (* or *)
    LinearRecurrence[{1, 1, -1}, {1, 0, 2}, 75] (* or *)
    CoefficientList[Series[(1 - x + x^2)/((1 - x) (1 - x^2)), {x, 0, 74}], x] (* Michael De Vlieger, May 21 2017 *)
    Table[{n,n-1},{n,40}]//Flatten (* Harvey P. Dale, Jun 26 2017 *)
    Table[3*floor(n/2)-n+1,{n,0,40}] (* Pierre-Alain Sallard, Dec 15 2018 *)
  • PARI
    {a(n) = (n\2) - (n%2) + 1} \\ Michael Somos, Oct 02 1999
    
  • PARI
    A028242(n)=n\2+!bittest(n,0) \\ M. F. Hasler, Oct 05 2017
    
  • Sage
    s=((1+x^3)/(1-x^2)^2).series(x, 80); s.coefficients(x, sparse=False) # G. C. Greubel, Dec 16 2018

Formula

Expansion of the Molien series for standard action of Quaternions on C^2: (1 + t^6) / (1 - t^4)^2 = (1 - t^12) / ((1 - t^4)^2 * (1 - t^6)) in powers of t^2.
Euler transform of length 6 sequence [0, 2, 1, 0, 0, -1]. - Michael Somos, Mar 14 2011
a(n) = n - a(n-1) [with a(0) = 1] = A000035(n-1) + A004526(n). - Henry Bottomley, Jul 25 2001
G.f.: (1 - x + x^2) / ((1 - x) * (1 - x^2)) = ( 1+x^2-x ) / ( (1+x)*(x-1)^2 ).
a(2*n) = n + 1, a(2*n + 1) = n, a(-1 - n) = -a(n).
a(n) = a(n - 1) + a(n - 2) - a(n - 3).
a(n) = floor(n/2) + 1 - n mod 2. a(2*k) = k+1, a(2*k+1) = k; A110657(n) = a(a(n)), A110658(n) = a(a(a(n))); a(n) = A109613(n)-A110654(n) = A110660(n)/A110654(n). - Reinhard Zumkeller, Aug 05 2005
a(n) = 2*floor(n/2) - floor((n-1)/2). - Wesley Ivan Hurt, Oct 22 2013
a(n) = floor((n+1+(-1)^n)/2). - Wesley Ivan Hurt, Mar 15 2015
a(n) = (1 + 2n + 3(-1)^n)/4. - Wesley Ivan Hurt, Mar 18 2015
a(n) = Sum_{i=1..floor(n/2)} floor(n/(n-i)) for n > 0. - Wesley Ivan Hurt, May 21 2017
a(2n) = n+1, a(2n+1) = n, for all n >= 0. - M. F. Hasler, Oct 05 2017
a(n) = 3*floor(n/2) - n + 1. - Pierre-Alain Sallard, Dec 15 2018
E.g.f.: ((2 + x)*cosh(x) + (x - 1)*sinh(x))/2. - Stefano Spezia, Aug 01 2022
Sum_{n>=2} (-1)^(n+1)/a(n) = 1. - Amiram Eldar, Oct 04 2022

Extensions

First part of definition adjusted to match offset by Klaus Brockhaus, Nov 23 2009

A166920 a(n) = 2^n - (1 + (-1)^n)/2.

Original entry on oeis.org

0, 2, 3, 8, 15, 32, 63, 128, 255, 512, 1023, 2048, 4095, 8192, 16383, 32768, 65535, 131072, 262143, 524288, 1048575, 2097152, 4194303, 8388608, 16777215, 33554432, 67108863, 134217728, 268435455, 536870912, 1073741823, 2147483648, 4294967295
Offset: 0

Views

Author

Paul Curtz, Oct 23 2009

Keywords

Comments

Partial sums of A014551. The inverse binomial transform yields a sequence 0,2,-1,5,-7,17,...: zero followed by a sign alternating A014551.
The table of a(n) plus higher order differences in successive rows shows A131577 on the main diagonal.
a(n) = 2^n when n is odd and 2^n-1 when n is even. - Wesley Ivan Hurt, Nov 15 2013

Crossrefs

Programs

Formula

G.f.: x*(2-x)/((1-x)*(1-2*x)*(1+x)).
a(n) = 2^n - (1+(-1)^n)/2.
a(2*n) = A024036(n); a(2*n+1) = A004171(n).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - 2*a(n) = A168361(n).
a(n) = A000225(n+1) - A051049(n) = A014551(n) - A168361(n).
E.g.f.: exp(2*x) - cosh(x). - G. C. Greubel, May 28 2016
a(n) = Sum_{k=1..n+1} Sum_{i=0..n+1} C(n-k,i). - Wesley Ivan Hurt, Sep 22 2017
a(n) = 2*A001045(n) + A000975(n-1) for n>0. - Yuchun Ji, Aug 30 2018

Extensions

Edited and extended by R. J. Mathar, Mar 02 2010

A030451 a(2*n) = n, a(2*n+1) = n+2.

Original entry on oeis.org

0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38, 37
Offset: 0

Views

Author

Daniel Smith (2true(AT)gte.net)

Keywords

Comments

Previous name was: Once started, this mixes the natural numbers and the natural numbers shifted by 1.
Smallest number of integer-sided squares needed to tile a 2 X n rectangle. a(5) = 4:
..._...
| | |_|
|_|___||. - _Alois P. Heinz, Jun 12 2013

Crossrefs

Cf. A168361 (first differences), A198442 (partial sums).
Row m=2 of A113881, A219158.
Essentially the same as A028242.

Programs

  • Maple
    a:= n-> iquo(n, 2, 'r') +[0, 2][r+1]:
    seq(a(n), n=0..80);  # Alois P. Heinz, Jun 12 2013
  • Mathematica
    Riffle[# + 1, #] &@ Range[0, 37] (* or *)
    Table[3/4 - (-1)^n 3/4 + n/2, {n, 0, 72}] (* or *)
    CoefficientList[Series[(2 x - x^2)/((1 - x) (1 - x^2)), {x, 0, 72}], x] (* Michael De Vlieger, Apr 25 2016 *)
  • PARI
    a(n)=n\2+2*(n%2)

Formula

a(n) = 3/4 -(-1)^n*3/4 +n/2.
G.f.: (2*x-x^2)/((1-x)*(1-x^2)).
a(2n) = n, a(2n+1) = n+2.
a(n+2) = a(n)+1.
a(n) = -a(-3-n).
a(n) = A110570(n,2) for n>1. - Reinhard Zumkeller, Jul 28 2005
a(n) = (n+1)-a(n-1) with n>0, a(0)=0. - Vincenzo Librandi, Nov 18 2010
a(n) = Sum_{k=1..n} (-1)^(n+k)*(k+1). - Arkadiusz Wesolowski, Nov 23 2012
a(n+1) = (a(0) + a(1) + ... + a(n))/a(n) for n>0. This formula with different initial conditions produces A008619. - Ivan Neretin, Apr 25 2016
E.g.f.: (x*exp(x) + 3*sinh(x))/2. - Ilya Gutkovskiy, Apr 25 2016
Sum_{n>=1} (-1)^n/a(n) = 1. - Amiram Eldar, Oct 04 2022

Extensions

New name (using existing formula) from Joerg Arndt, Apr 26 2016

A327767 Period 2: repeat [1, -2].

Original entry on oeis.org

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

Views

Author

Michael Somos, Sep 24 2019

Keywords

Examples

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

Crossrefs

Programs

  • Magma
    &cat [[1, -2]^^50]; // Vincenzo Librandi, Feb 29 2020
  • Mathematica
    a[ n_] := If[ n < 1, 0, -2 + 3 Mod[n, 2]];
    a[ n_] := Which[ n < 1, 0, OddQ[n], 1, True, -2];
    a[ n_] := SeriesCoefficient[ (x - 2*x^2) / (1 - x^2), {x, 0, n}];
    PadRight[{}, 100, {1, -2}] (* Vincenzo Librandi, Feb 29 2020 *)
  • PARI
    {a(n) = if( n<1, 0, -(1 + 3*(-1)^n)/2)};
    
  • PARI
    {a(n) = if( n<1, 0, -2 + 3*(n%2))};
    
  • PARI
    {a(n) = if( n<1, 0, [-2, 1][n%2 + 1])};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (x - 2*x^2) / (1 - x^2) + x * O(x^n), n))};
    

Formula

G.f.: x * (1 - 2*x) / (1 - x^2) = x / (1 + 2*x / (1 - 3*x / (2 - x))).
E.g.f.: (exp(x) - 1)*(3/exp(x) - 1)/2.
a(n) is multiplicative with a(2^e) = -2 if e>0, a(p^e) = 1 otherwise.
Moebius transform is length 2 sequence [1, -3].
a(n) = -(1 + 3*(-1)^n)/2 if n>=1.
a(2*n) = -2, a(2*n + 1) = 1, a(0) = 0.
a(n) = -(-1)^n * A134451(n) for all n in Z.
a(n) = a(n+2) = -(-1)^n * A000034(n-1) = -A168361(n+1) for n>=1.
Dirichlet g.f.: zeta(s)*(1-3/2^s). - Amiram Eldar, Jan 03 2023

A280193 a(2*n) = 2, a(2*n + 1) = -1, a(0) = 1.

Original entry on oeis.org

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

Views

Author

Michael Somos, Dec 28 2016

Keywords

Examples

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

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x+x^2)/(1-x^2))); // G. C. Greubel, Jul 29 2018
  • Mathematica
    a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], -1, True, 2];
    a[ n_] := SeriesCoefficient[ (1 - x + x^2) / (1 - x^2), {x, 0, n}];
    LinearRecurrence[{0,1},{1,-1,2},80] (* Harvey P. Dale, Aug 06 2025 *)
  • PARI
    {a(n) = if( n<1, n==0, 2 - 3*(n%2))};
    
  • PARI
    {a(n) = if( n<1, n==0, [2, -1][n%2 + 1])};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 - x + x^2) / (1 - x^2) + x * O(x^n), n))};
    

Formula

Euler transform of length 6 sequence [-1, 2, 1, 0, 0, -1].
Moebius transform is length 2 sequence [-1, 3].
a(n) = -b(n) where b() is multiplicative with b(2^e) = -2 if e>0, b(p^e) = 1 otherwise.
G.f.: (1 - x + x^2) / (1 - x^2).
G.f.: (1 - x) * (1 - x^6) / ((1 - x^3) * (1 -x^2)^2).
G.f.: 1 / (1 + x / (1 + x / (1 - 3*x / (1 + x)))).
a(n) = (-1)^n * A040001(n).
A028242(n) = Sum_{k=0..n} a(k).
A117575(n+1) = Product_{k=0..n} a(k).
A000225(n-1) = Sum_{k=0..n} binomial(n, k) * a(k) if n>0.
A000325(n) = Sum_{k=0..n} binomial(n, k+1) * a(k) if n>0.
a(n) = Sum_{k=0..n} binomial(n, k) * (-1)^k * A083329(k).
A079583(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n.
a(n) = A168361(n+1), n>0. - R. J. Mathar, Jan 04 2017

A216178 Period 4: repeat [4, 1, 0, -3].

Original entry on oeis.org

4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3
Offset: 0

Views

Author

Brad Clardy, Mar 10 2013

Keywords

Crossrefs

Programs

  • Magma
    for n in [0 .. 50] do (3*(-1)^n+1)/2 + 2*(-1)^((2*n-1+(-1)^n)/4); end for;
    
  • Magma
    &cat [[4, 1, 0, -3]^^30]; // Wesley Ivan Hurt, Jul 09 2016
    
  • Maple
    seq(op([4, 1, 0, -3]), n=0..40); # Wesley Ivan Hurt, Jul 09 2016
  • Mathematica
    PadRight[{},100,{4,1,0,-3}] (* or *) LinearRecurrence[{0,0,0,1},{4,1,0,-3},100] (* Harvey P. Dale, Nov 28 2014 *)
  • PARI
    a(n)=[4, 1, 0, -3][n%4+1] \\ Charles R Greathouse IV, Jul 17 2016

Formula

a(n) = (3*(-1)^n+1)/2 + 2*(-1)^((2*n-1+(-1)^n)/4).
a(n) = A168361(n+1) + A084100(n+4).
G.f.: (4+x-3*x^3) / ((1-x)*(1+x)*(1+x^2)). - R. J. Mathar, Mar 10 2013
a(n+4) = a(n). - Alexander R. Povolotsky, Mar 15 2013
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = 1/2+3*I^(2*n)/2+(1+I)*I^(-n)+(1-I)*I^n.
a(n) = (1+3*cos(n*Pi)+4*cos(n*Pi/2)+4*sin(n*Pi/2)+3*I*sin(n*Pi))/2. (End)

A280166 a(2*n) = 4*n if n>0, a(2*n + 1) = -(2*n + 1), a(0) = 1.

Original entry on oeis.org

1, -1, 4, -3, 8, -5, 12, -7, 16, -9, 20, -11, 24, -13, 28, -15, 32, -17, 36, -19, 40, -21, 44, -23, 48, -25, 52, -27, 56, -29, 60, -31, 64, -33, 68, -35, 72, -37, 76, -39, 80, -41, 84, -43, 88, -45, 92, -47, 96, -49, 100, -51, 104, -53, 108, -55, 112, -57, 116
Offset: 0

Views

Author

Michael Somos, Dec 27 2016

Keywords

Examples

			G.f. = 1 - x + 4*x^2 - 3*x^3 + 8*x^4 - 5*x^5 + 12*x^6 - 7*x^7 + 16*x^8 + ...
		

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x+x^2)*(1+x^2)/(1-x^2)^2)); // G. C. Greubel, Aug 04 2018
  • Mathematica
    a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], -n, True, 2 n];
    a[ n_] := SeriesCoefficient[ (1 - x + x^2) (1 + x^2) / (1 - x^2)^2, {x, 0, n}];
  • PARI
    {a(n) = if( n<1, n==0, n%2, -n, 2*n)};
    
  • PARI
    x='x+O('x^50); Vec((1-x+x^2)*(1+x^2)/(1-x^2)^2) \\ G. C. Greubel, Aug 04 2018
    

Formula

Euler transform of length 6 sequence [-1, 4, 1, -1, 0, -1].
a(n) = (-1)^n * A257088(n), with A257088 multiplicative (see there).
a(n) = n * A168361(n+1) if n>0.
a(2*n) = A008574(n). a(2*n + 1) = - A005408(n).
G.f.: (1 - x + x^2) * (1 + x^2) / (1 - x^2)^2.

Extensions

Edited by M. F. Hasler, May 08 2018
Showing 1-7 of 7 results.