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.

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