%I #50 Oct 11 2022 06:33:49
%S 1,1,0,1,2,0,0,1,0,2,0,0,2,0,0,1,2,0,0,2,0,0,0,0,2,2,0,0,2,0,0,1,0,2,
%T 0,0,2,0,0,2,2,0,0,0,0,0,0,0,0,2,0,2,2,0,0,0,0,2,0,0,2,0,0,1,4,0,0,2,
%U 0,0,0,0,2,2,0,0,0,0,0,2,0,2,0,0,4,0,0,0,2,0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,0
%N a(n) = Product_{ odd primes p | n } (1 + Legendre(-1,p) ).
%D Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (2) (but without the restriction that a(4k) = 0).
%H G. C. Greubel, <a href="/A091400/b091400.txt">Table of n, a(n) for n = 1..5000</a>
%F Here we use the definition that Legendre(-1, 2) = 0, Legendre(-1, p) = 1 if p == 1 mod 4, = -1 if p == 3 mod 4. This is Shimura's definition, which is different from Maple's.
%F a(n) is multiplicative with:
%F a(2^e) = 1 for e >= 0,
%F a(p^e) = 0 if p == 3 (mod 4) for e > 0,
%F a(p^e) = 2 if p == 1 (mod 4) for e > 0.
%F (corrected by _Werner Schulte_, Dec 12 2020.
%F a(2*n) = a(n). a(3*n) = a(4*n + 3) = 0.
%F a(3*n + 1) = A122865(n). a(3*n + 2) = A122856(n).
%F a(n) = Sum_{d|n} b(d)*(-1)^bigomega(d)*moebius(d) where b(2n)=0 and b(2n+1)=(-1)^n. - _Benoit Cloitre_, Apr 17 2016
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/Pi = 0.636619... (A060294). - _Amiram Eldar_, Oct 11 2022
%e G.f. = x + x^2 + x^4 + 2*x^5 + x^8 + 2*x^10 + 2*x^13 + x^16 + 2*x^17 + 2*x^20 + ...
%p with(numtheory): A091400 := proc(n) local i,t1,t2; t1 := ifactors(n)[2]; t2 := 1; for i from 1 to nops(t1) do if t1[i][1] > 2 then t2 := t2*(1+legendre(-1,t1[i][1])); fi; od: t2; end;
%p with(numtheory): seq(mul(1+legendre(-1,p),p in select(isprime, divisors(n) minus {2})),n=1..105); # _Peter Luschny_, Apr 20 2016
%t Legendre[-1, p_] := Which[p==2, 0, Mod[p, 4]==1, 1, True, -1]; a[1] = 1; a[n_] := Times @@ (Legendre[-1, #] + 1&) /@ FactorInteger[n][[All, 1]]; Array[a, 105] (* _Jean-François Alcover_, Dec 01 2015 *)
%t Join[{1},Table[Product[1+JacobiSymbol[-1,p],{p,Complement[FactorInteger[n][[All, 1]], {2}]}], {n,2,105}]] (* _Peter Luschny_, Apr 20 2016 *)
%o (PARI) {a(n)=if(n<1,0,sumdiv(n,d,(-1)^bigomega(d)*moebius(d)*if(d%2,(-1)^(d\2),0)))} \\ _Benoit Cloitre_, Apr 17 2016
%Y Cf. A060294, A091379, A122856, A122865, A129448.
%K nonn,mult
%O 1,5
%A _N. J. A. Sloane_, Mar 02 2004
%E Definition clarified by _Peter Luschny_, Apr 20 2016
|