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!)
A162512 Dirichlet inverse of A162511. 3
1, -1, -1, 2, -1, 1, -1, -4, 2, 1, -1, -2, -1, 1, 1, 8, -1, -2, -1, -2, 1, 1, -1, 4, 2, 1, -4, -2, -1, -1, -1, -16, 1, 1, 1, 4, -1, 1, 1, 4, -1, -1, -1, -2, -2, 1, -1, -8, 2, -2, 1, -2, -1, 4, 1, 4, 1, 1, -1, 2, -1, 1, -2, 32, 1, -1, -1, -2, 1, -1, -1, -8, -1, 1, -2, -2, 1, -1, -1, -8, 8, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
The absolute value of this sequence is A162510.
The Moebius function (A008683) can be defined in terms of this sequence: A008683(n) is equal to a(n) if a(n) is odd and zero otherwise.
LINKS
FORMULA
Multiplicative function with a(p^e)=-(-2)^(e-1) for any prime p and any positive exponent e.
a(n) = n/2 when n is a power of 4 (A000302).
a(n) = A008683(n) when n is a squarefree number (A005117).
Dirichlet g.f.: Product_{p prime} ((p^s + 1)/(p^s + 2)). - Amiram Eldar, Oct 26 2023
MAPLE
A162512 := proc(n)
local a, f;
a := 1;
for f in ifactors(n)[2] do
a := -a*(-2)^(op(2, f)-1) ;
end do:
return a;
end proc:
seq(A162512(n), n=1..100) ; # R. J. Mathar, May 20 2017
MATHEMATICA
b[n_] := (-1)^(PrimeOmega[n] - PrimeNu[n]);
a[n_] := a[n] = If[n == 1, 1, -Sum[b[n/d] a[d], {d, Most@ Divisors[n]}]];
Array[a, 100] (* Jean-François Alcover, Feb 17 2020 *)
PROG
(PARI) a(n) = my(f=factor(n)); for(i=1, #f~, f[i, 1]=-(-2)^(f[i, 2]-1); f[i, 2]=1); factorback(f); \\ Michel Marcus, May 20 2017
(Python)
from sympy import factorint
from operator import mul
def a(n):
f=factorint(n)
return 1 if n==1 else reduce(mul, [-(-2)**(f[i] - 1) for i in f]) # Indranil Ghosh, May 20 2017
(Scheme) (define (A162512 n) (if (= 1 n) n (* (- (expt -2 (- (A067029 n) 1))) (A162512 (A028234 n))))) ;; Antti Karttunen, May 20 2017, after the given multiplicative formula.
CROSSREFS
Sequence in context: A104404 A351655 A351656 * A162510 A292589 A297404
KEYWORD
easy,mult,sign
AUTHOR
Gerard P. Michon, Jul 05 2009, Jul 06 2009
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 March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)