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

A259042 Period 8 sequence [0, 1, 1, 1, 2, 1, 1, 1, ...].

Original entry on oeis.org

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

Views

Author

Michael Somos, Jun 17 2015

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    a[ n_] := {1, 1, 1, 2, 1, 1, 1, 0}[[Mod[n, 8, 1]]];
    a[ n_] := SeriesCoefficient[ 1 / (1 - x) - 1 / (1 + x^4), {x, 0, Abs@n}];
  • PARI
    {a(n) = 1 + (n%4 == 0) - 2*(n%8 == 0)};
    
  • PARI
    {a(n) = [ 0, 1, 1, 1, 2, 1, 1, 1][n%8 + 1]};
    
  • PARI
    {a(n) = polcoeff( 1 / (1 - x) - 1 / (1 + x^4) + x * O(x^abs(n)), abs(n))};

Formula

Euler transform of length 8 sequence [1, 0, 1, -1, 0, -1, 0, 1].
Moebius transform is length 8 sequence [1, 0, 0, 1, 0, 0, 0, -2].
a(n) is multiplicative with a(2) = 1, a(4) = 2, a(2^e) = 0 if e > 2, a(p^e) = 1 if p > 2.
G.f.: x * (1 + x^3)/((1-x)*(1 + x^4)).
G.f.: x * (1 - x^4)*(1 - x^6)/((1-x)*(1 - x^3)*(1 - x^8)).
G.f.: 1/(1-x) - 1/(1 + x^4).
a(n) = a(-n) = a(n+8) for all n in Z.
a(2*n + 1) = a(4*n + 2) = 1. a(8*n) = 0. a(8*n + 4) = 2.
a(n) = A257179(n+4) unless n = -4.
Dirichlet g.f.: zeta(s) * (1 + 4^(-s) - 2 * 8^(-s)). - Álvar Ibeas, Mar 18 2021

Extensions

More terms from Antti Karttunen, Jul 29 2018

A257181 Expansion of (1 - x) * (1 + x^4) / (1 + x^5) in powers of x.

Original entry on oeis.org

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

Views

Author

Michael Somos, Apr 17 2015

Keywords

Examples

			G.f. = 1 - x + x^4 - 2*x^5 + x^6 - x^9 + 2*x^10 - x^11 + x^14 - 2*x^15 + ...
		

Crossrefs

Programs

  • Magma
    m:=60; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x)*(1+x^4)/(1+x^5))); // G. C. Greubel, Aug 02 2018
  • Mathematica
    a[ n_] := -Boole[n == 0] + {-1, 0, 0, 1, -2, 1, 0, 0, -1, 2}[[Mod[n, 10, 1]]];
    a[ n_] := SeriesCoefficient[ (1 - x) * (1 + x^4) / (1 + x^5), {x, 0, Abs@n}];
    CoefficientList[Series[(1-x)*(1+x^4)/(1+x^5), {x, 0, nmax}], x] (* G. C. Greubel, Aug 02 2018 *)
  • PARI
    {a(n) = if( n==0, 1, (-1)^(n\5) * [2, -1, 0, 0, 1][n%5 + 1])};
    
  • PARI
    {a(n) = polcoeff( (1 - x) * (1 + x^4) / (1 + x^5) + x * O(x^abs(n)), abs(n))};
    
  • PARI
    x='x+O('x^60); Vec((1-x)*(1+x^4)/(1+x^5)) \\ G. C. Greubel, Aug 02 2018
    

Formula

Euler transform of length 10 sequence [-1, 0, 0, 1, -1, 0, 0, -1, 0, 1].
a(n) = a(-n) for all n in Z. a(n+5) = -a(n) unless n = 0 or -5. a(5*n) = 2 * (-1)^n unless n = 0. a(5*n + 2) = a(5*n + 3) = 0. a(5*n + 1) = a(5*n - 1) = -(-1)^n.
G.f.: (1 - x) * (1 + x^4) / (1 + x^5).
G.f.: (1 - x) * (1 - x^5) * (1 - x^8) / ((1 - x^4) * (1 - x^10)).
Convolution inverse is A257179.
a(n) = (-1)^floor( (n+4) / 5) * A164116(n).

A323191 Expansion of (1 - x^5) / ((1 + x) * (1 + x^4)) in powers of x.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jan 06 2019

Keywords

Examples

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

Crossrefs

Cf. A257179.

Programs

  • Mathematica
    a[ n_] := (-1)^n + If[Mod[n, 4] == 0, (-1)^(n/4), 0] - Boole[n == 0];
    a[ n_] := {-1, 1, -1, 0, -1, 1, -1, 2}[[Mod[n, 8, 1]]] - Boole[n == 0];
    a[ n_] := SeriesCoefficient[ (1 - x^5) / ((1 + x) * (1 + x^4)), {x, 0, Abs@n}];
  • PARI
    {a(n) = (-1)^n + if(n%4==0, (-1)^(n/4)) - (n==0)};
    
  • PARI
    {a(n) = [2, -1, 1, -1, 0, -1, 1, -1][n%8 + 1] - (n==0)};
    
  • PARI
    {a(n) = n=abs(n); polcoeff(  (1 - x^5) / ((1 + x) * (1 + x^4)) + x * O(x^n), n)};
    
  • PARI
    {a(n) = my(e); n=abs(n); if( n<1, n==0, e=valuation(n, 2); -if( e<3, [1, -1, 0][e+1], -2))};

Formula

a(n) = -b(n) and b() is multiplicative with b(2) = -1, b(4) = 0, b(2^e) = -2 if e>2, b(p^e) = 1 if p>2.
Euler transform of length 8 sequence [-1, 1, 0, -1, -1, 0, 0, 1].
Moebius transform is length 8 sequence [-1, 2, 0, -1, 0, 0, 0, 2].
G.f.: (1 - x^5) / ((1 + x) * (1+ x^4)) = -1 + 1 / (1 + x) + 1 / (1 + x^4).
a(n) = a(-n) for all n in Z. a(n+4) = a(n-4) except if n=4 or n=-4.
a(n) = (-1)^n * A257179(n), a(2*n + 1) = -1, a(4*n + 2) = 1, a(8*n + 4) = 0 for all n in Z.
Showing 1-3 of 3 results.