login
A232597
a(n) = sum of odd k in 1..n for which Kronecker(k,n)=1.
2
1, 1, 1, 4, 1, 6, 1, 8, 13, 13, 18, 8, 13, 31, 1, 64, 38, 25, 50, 40, 23, 78, 26, 24, 124, 131, 65, 84, 83, 94, 66, 128, 103, 158, 143, 216, 137, 212, 42, 160, 224, 156, 242, 176, 132, 327, 147, 176, 513, 297, 259, 312, 303, 246, 170, 224, 303, 365, 509, 240
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
Restricted to primes: A232505(n) = a(A000040(n)). Cf. also A228131.
Sequence in context: A005451 A135683 A113520 * A197008 A344442 A316223
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 26 2013
STATUS
approved