|
|
A259022
|
|
Period 9 sequence [ 1, -1, -1, 1, 0, -1, 1, 1, -1, ...].
|
|
2
|
|
|
1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, -1, -1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0
|
|
LINKS
|
|
|
FORMULA
|
Euler transform of length 9 sequence [ -1, -1, 0, 0, -1, 0, 0, 0, 1].
a(n) = b(2*n+1) where b() is multiplicative with b(2^e) = 0^e, a(3) = -1, a(3^e) = 0 if e>1, b(p^e) = 1 if p == 1 (mod 6), b(p^e) = (-1)^e if p == 5 (mod 6).
G.f.: (1 - x) * (1 - x^2) * (1 - x^5) / (1 - x^9).
a(n) = -a(-1-n) = a(n+9) for all n in Z.
|
|
EXAMPLE
|
G.f. = 1 - x - x^2 + x^3 - x^5 + x^6 + x^7 - x^8 + x^9 - x^10 - x^11 + ...
G.f. = q - q^3 - q^5 + q^7 - q^11 + q^13 + q^15 - q^17 + q^19 - q^21 + ...
|
|
MATHEMATICA
|
a[ n_] := { 1, -1, -1, 1, 0, -1, 1, 1, -1} [[Mod[ n, 9] + 1]];
|
|
PROG
|
(PARI) {a(n) = [ 1, -1, -1, 1, 0, -1, 1, 1, -1] [n%9 + 1]};
(PARI) {a(n) = my(A, p, e); if( n<0, n=-1-n; -1, 1) * if( n==0, 1, A = factor(2*n + 1); prod( k=1, matsize(A)[1], [p, e] = A[k, ]; if( p==2, 0, p==3, -(e==1), p%6==1, 1, (-1)^e)))};
(Haskell)
a259022 n = a259022_list !! n
a259022_list = cycle [1, -1, -1, 1, 0, -1, 1, 1, -1]
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|