OFFSET
1,2
REFERENCES
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 and with a different definition of Legendre(-1,2)).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
Here we use the definition that Legendre(-1, 2) = 1, Legendre(-1, p) = 1 if p == 1 mod 4, = -1 if p == 3 mod 4.
From Amiram Eldar, Oct 11 2022: (Start)
Multiplicative with a(p^e) = 0 if p == 3 (mod 4) and 2 otherwise.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/Pi = 0.954929... (A089491). (End)
MAPLE
with(numtheory); A091379 := proc(n) local i, t1, t2; t1 := ifactors(n)[2]; t2 := mul((1+legendre(-1, t1[i][1])), i=1..nops(t1)); end;
MATHEMATICA
a[n_] := Module[{t1, t2}, t1 = FactorInteger[n]; t2 = Product[(1 + KroneckerSymbol[-1, t1[[i, 1]]]), {i, 1, Length[t1]}]]; a[1] = 1;
Array[a, 105] (* Jean-François Alcover, Feb 08 2022, from Maple code *)
PROG
(PARI)
vecproduct(v) = { my(m=1); for(i=1, #v, m *= v[i]); m; };
A091379(n) = vecproduct(apply(p -> (1 + kronecker(-1, p)), factorint(n)[, 1])); \\ Antti Karttunen, Nov 18 2017
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
N. J. A. Sloane, Mar 02 2004
STATUS
approved