login
A290099
Multiplicative with a(2^e) = (-1)^e and a(p^e) = prevprime(p)^e for odd primes p.
1
1, -1, 2, 1, 3, -2, 5, -1, 4, -3, 7, 2, 11, -5, 6, 1, 13, -4, 17, 3, 10, -7, 19, -2, 9, -11, 8, 5, 23, -6, 29, -1, 14, -13, 15, 4, 31, -17, 22, -3, 37, -10, 41, 7, 12, -19, 43, 2, 25, -9, 26, 11, 47, -8, 21, -5, 34, -23, 53, 6, 59, -29, 20, 1, 33, -14, 61, 13, 38, -15, 67, -4, 71, -31, 18, 17, 35, -22, 73, 3, 16, -37, 79, 10, 39, -41, 46, -7, 83, -12, 55
OFFSET
1,3
FORMULA
a(1) = 1, after which, for even n: a(n) = -a(n/2), for odd n: a(n) = A000040(A055396(n)-1) * a(A032742(n)).
a(n) = (-1)^A007814(n) * A064989(n).
PROG
(Scheme) (define (A290099 n) (cond ((= 1 n) n) ((even? n) (- (A290099 (/ n 2)))) (else (* (A000040 (+ -1 (A055396 n))) (A290099 (A032742 n))))))
(Python)
from sympy import factorint, prevprime
from operator import mul
from functools import reduce
def a(n): return 1 if n==1 else reduce(mul, [(-1)**e if p==2 else prevprime(p)**e for p, e in factorint(n).items()])
print([a(n) for n in range(1, 61)]) # Indranil Ghosh, Aug 08 2017
CROSSREFS
Cf. A007814, A064989 (absolute values of the terms), A064216 (odd bisection).
Sequence in context: A268674 A250470 A064989 * A250479 A299200 A332819
KEYWORD
sign,mult
AUTHOR
Antti Karttunen, Aug 08 2017
STATUS
approved