OFFSET
0,5
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65537
Michael Somos, Rational Function Multiplicative Coefficients
Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
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
EXAMPLE
G.f. = x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + x^7 + x^9 + x^10 + x^11 + ...
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}];
PROG
(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))};
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Michael Somos, Jun 17 2015
EXTENSIONS
More terms from Antti Karttunen, Jul 29 2018
STATUS
approved