OFFSET
1,5
COMMENTS
Seems to have no modular form.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..1000
Wikipedia, Quadratic residue
FORMULA
EXAMPLE
a(1), a(2), a(3) and a(4) are all 1, as for the corresponding primes 2, 3, 5 and 7 the quadratic residue sets are {1}, {1}, {1,4} and {1,2,4}, in which all cases, only 1 is an odd residue.
For a(5), which is computed for the 5th prime, 11, we have a set of its quadratic residues (those less than 11) as {1,3,4,5,9}, of which when we sum only the odd residues, 1+3+5+9, we get a(5) = 18.
MATHEMATICA
Table[Function[p, Total@ Select[Range[1, p, 2], JacobiSymbol[#, p] == 1 &]]@ Prime@ n, {n, 62}] (* Michael De Vlieger, May 14 2017 *)
PROG
(PARI) A232597(n) = {s=0; for(k=1, n, s=s+((k%2)*((1+kronecker(k, n))\2)*k)); return(s); }
forprime (i=1, 300, print1(A232597(i), ", ")) \\ Antti Karttunen, Nov 26 2013
(Python)
from sympy.ntheory.residue_ntheory import quadratic_residues as q
from sympy import prime
def a(n): return sum(i for i in q(prime(n)) if i%2)
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, May 14 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Nov 25 2013
EXTENSIONS
Missing 1 (as a(1) is value for the first prime, 2) inserted into beginning by Antti Karttunen, Nov 26 2013
STATUS
approved