login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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.
a(n) = A259024(2*n + 1).
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]
-- Reinhard Zumkeller, Jun 17 2015
CROSSREFS
Cf. A259024.
Sequence in context: A188470 A333922 A071026 * A153490 A014194 A014379
KEYWORD
sign,easy
AUTHOR
Michael Somos, Jun 16 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:38 EDT 2024. Contains 371794 sequences. (Running on oeis4.)