login
A231589
a(n) = sum_{k=1..(n-1)/2} (k^2 mod n).
3
0, 0, 1, 1, 5, 5, 7, 6, 12, 20, 22, 19, 39, 35, 35, 28, 68, 60, 76, 65, 91, 99, 92, 74, 125, 156, 144, 147, 203, 175, 186, 152, 242, 272, 245, 201, 333, 323, 286, 270, 410, 392, 430, 363, 420, 437, 423, 340, 490, 550, 578, 585, 689, 639, 605, 546, 760, 812
OFFSET
1,5
COMMENTS
This expression occurred to S. A. Shirali while demonstrating a result concerning A081115 and A228432. This led him to investigate integers n such that a(n) = n*(n-1)/4, a(n) = floor(n/4), or a(n) = n*(n-1)/4 - n.
LINKS
S. A. Shirali, A family portrait of primes-a case study in discrimination, Math. Mag. Vol. 70, No. 4 (Oct., 1997), pp. 263-272.
MATHEMATICA
Table[Sum[PowerMod[k, 2, n], {k, (n-1)/2}], {n, 60}] (* Harvey P. Dale, Jan 30 2016 *)
PROG
(PARI) a(n) = sum(k=1, (n-1)\2, k^2 % n);
CROSSREFS
Sequence in context: A247649 A252655 A021646 * A133888 A244587 A111186
KEYWORD
nonn
AUTHOR
Michel Marcus, Nov 11 2013
STATUS
approved