login
A255644
Difference between sums of quadratic residues and non-residues modulo n (residues are not necessarily coprime to n).
3
0, 1, -1, -4, 0, 1, -7, -18, -12, 5, -11, -38, 0, -7, -45, -92, 0, -33, -19, -120, -70, -11, -69, -192, -50, 13, -99, -210, 0, -135, -93, -352, -198, 17, -245, -438, 0, -19, -325, -510, 0, -245, -43, -550, -540, -115, -235, -880, -196, -175, -459, -728, 0, -333, -715, -1036, -532, 29, -177, -1230, 0, -155, -1155, -1440, -780, -693, -67, -1292, -966, -875, -497, -1908, 0, 37, -1325, -1558, -1232, -1079, -395, -2500, -864, 41, -249, -2366, -1360, -43, -1479, -2552, 0, -2025, -1729, -2346, -1426, -423, -2185, -3568, 0, -637, -2673, -3000
OFFSET
1,4
FORMULA
For prime n, a(n) = A228131(n) = A255643(n).
For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).
PROG
(PARI) { A255643(n) = my(r); r=0; for(i=0, n-1, if(issquare(Mod(i, n)), r+=i, r-=i) ); r }
CROSSREFS
Sequence in context: A338813 A334385 A201560 * A355174 A059678 A079642
KEYWORD
sign
AUTHOR
Max Alekseyev, Mar 01 2015
STATUS
approved