This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A091400 #54 Jan 14 2025 01:47:26 %S A091400 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 A091400 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 A091400 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 A091400 a(n) = Product_{ odd primes p | n } (1 + Legendre(-1,p) ). %D A091400 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 A091400 G. C. Greubel, <a href="/A091400/b091400.txt">Table of n, a(n) for n = 1..5000</a> %F A091400 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 A091400 a(n) is multiplicative with: %F A091400 a(2^e) = 1 for e >= 0, %F A091400 a(p^e) = 0 if p == 3 (mod 4) for e > 0, %F A091400 a(p^e) = 2 if p == 1 (mod 4) for e > 0. %F A091400 (corrected by _Werner Schulte_, Dec 12 2020). %F A091400 a(2*n) = a(n). a(3*n) = a(4*n + 3) = 0. %F A091400 a(3*n + 1) = A122865(n). a(3*n + 2) = A122856(n). %F A091400 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 A091400 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/Pi = 0.636619... (A060294). - _Amiram Eldar_, Oct 11 2022 %e A091400 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 A091400 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 A091400 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 A091400 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 A091400 Join[{1},Table[Product[1+JacobiSymbol[-1,p],{p,Complement[FactorInteger[n][[All, 1]], {2}]}], {n,2,105}]] (* _Peter Luschny_, Apr 20 2016 *) %o A091400 (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 A091400 Cf. A060294, A091379, A122856, A122865, A129448. %K A091400 nonn,mult %O A091400 1,5 %A A091400 _N. J. A. Sloane_, Mar 02 2004 %E A091400 Definition clarified by _Peter Luschny_, Apr 20 2016