%I #7 Feb 11 2020 02:04:17
%S 0,1,-1,-4,0,1,-7,-18,-12,5,-11,-38,0,-7,-45,-92,0,-33,-19,-120,-70,
%T -11,-69,-192,-50,13,-99,-210,0,-135,-93,-352,-198,17,-245,-438,0,-19,
%U -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
%N Difference between sums of quadratic residues and non-residues modulo n (residues are not necessarily coprime to n).
%F For prime n, a(n) = A228131(n) = A255643(n).
%F For prime n==1 (mod 4), a(n) = 0.
%F For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).
%o (PARI) { A255643(n) = my(r); r=0; for(i=0,n-1, if(issquare(Mod(i,n)), r+=i, r-=i) ); r }
%Y Cf. A228131, A255643.
%K sign
%O 1,4
%A _Max Alekseyev_, Mar 01 2015