OFFSET
1,4
MAPLE
A232597 := proc(n)
local a;
a := 0 ;
for k from 1 to n by 2 do
if numtheory[jacobi](k, n) = 1 then
a := a+k ;
end if;
end do:
a ;
end proc: # R. J. Mathar, May 25 2017
PROG
(PARI)
A232597(n) = {s=0; for(k=1, n, s=s+((k%2)*((1+kronecker(k, n))\2)*k)); return(s); }
for(n=1, 60, print1(A232597(n), ", "))
(PARI) a(n)=my(s); forstep(k=1, n, if(kronecker(k, n)==1, s+=k)); s \\ Charles R Greathouse IV, Nov 26 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 26 2013
STATUS
approved