cp's OEIS Frontend

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.

A091379 a(n) = Product_{ p | n } (1 + Legendre(-1,p) ).

Original entry on oeis.org

1, 2, 0, 2, 2, 0, 0, 2, 0, 4, 0, 0, 2, 0, 0, 2, 2, 0, 0, 4, 0, 0, 0, 0, 2, 4, 0, 0, 2, 0, 0, 2, 0, 4, 0, 0, 2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 2, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 2, 4, 0, 0, 4, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 2, 0, 0, 4, 0
Offset: 1

Views

Author

N. J. A. Sloane, Mar 02 2004

Keywords

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)).

Crossrefs

Programs

  • 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 *)
  • 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

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)