login
Suppose n has prime factorization n = p1^a1 * p2^a2 * ... * pk^ak. Then a(n) = (-1)^(n1 + n2 + ... + nk) if all the ai are ni^2 and a(n) = 0 otherwise.
3

%I #44 Nov 09 2023 08:53:16

%S 1,-1,-1,0,-1,1,-1,0,0,1,-1,0,-1,1,1,1,-1,0,-1,0,1,1,-1,0,0,1,0,0,-1,

%T -1,-1,0,1,1,1,0,-1,1,1,0,-1,-1,-1,0,0,1,-1,-1,0,0,1,0,-1,0,1,0,1,1,

%U -1,0,-1,1,0,0,1,-1,-1,0,1,-1,-1,0,-1,1,0,0,1,-1,-1,-1,1,1,-1,0,1,1,1,0,-1,0,1,0,1,1,1,0,-1,0,0,0,-1,-1,-1,0,-1

%N Suppose n has prime factorization n = p1^a1 * p2^a2 * ... * pk^ak. Then a(n) = (-1)^(n1 + n2 + ... + nk) if all the ai are ni^2 and a(n) = 0 otherwise.

%C Differs from A219009 at n=32, 96, 160, 224, 243, 256, 352, ... - _R. J. Mathar_, May 28 2016

%H Antti Karttunen, <a href="/A197774/b197774.txt">Table of n, a(n) for n = 1..10000</a>

%H Mathematics StackExchange, <a href="http://math.stackexchange.com/questions/73354/two-dirichlets-series-related-to-the-divisor-summatory-function-and-to-the-riem">Two Dirichlet's series related to the Divisor Summatory Function and to the Riemann's zeta-function</a>.

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.

%F Multiplicative with a(p^e) = (-1)^sqrt(e) if e is a square, 0 otherwise. - _Franklin T. Adams-Watters_, Oct 18 2011

%F From _Amiram Eldar_, Nov 09 2023:

%F a(n) = (-1)^A001222(n) if n is in A197680 and 0 otherwise.

%F Limit_{m->oo} (1/m) * Sum_{k=1..m} abs(a(k)) = 0.64111516... (A357016). (End)

%e From _Michael De Vlieger_, Jul 24 2017: (Start)

%e a(5) = -1 since 5^1 has an exponent 1 that is a perfect square, thus (-1)^sqrt(1) = -1.

%e a(6) = 1 since 6 = 2^1 * 3^1; both exponents are perfect squares thus (-1)^sqrt(1) * (-1)^sqrt(1) = -1 * -1 = 1.

%e a(12) = 0 since 12 = 2^2 * 3^1. One exponent (1) is a perfect square but the other (2) is not, thus 0 * (-1)^sqrt(1) = 0.

%e (End)

%p A197774 := proc(n)

%p local a,pf,e ;

%p a := 1 ;

%p for pf in ifactors(n)[2] do

%p e := pf[2] ;

%p if issqr(e) then

%p a := a*(-1)^sqrt(e) ;

%p else

%p a := 0 ;

%p end if;

%p end do;

%p a;

%p end proc: # _R. J. Mathar_, May 28 2016

%t Table[If[n == 1, 1, Apply[Times, FactorInteger[n] /. {p_, e_} /; p > 0 :> If[IntegerQ@ Sqrt@ e, (-1)^Sqrt@ e, 0]]], {n, 105}] (* _Michael De Vlieger_, Jul 24 2017 *)

%o (PARI) A197774(n) = { my(f=factor(n)[, 2]); prod(i=1, #f, if(issquare(f[i]),(-1)^sqrtint(f[i]),0)); }; \\ _Antti Karttunen_, Jul 24 2017

%Y Cf. A001222, A197680, A219009, A357016.

%K sign,easy,mult

%O 1

%A _A. Neves_, Oct 18 2011

%E More terms from _Antti Karttunen_, Jul 24 2017