login
A166387
a(n) = sum (floor (j^2/n), 1 <= j <= n-1) - floor ((n-1)(n-2)/3), n >= 2.
2
0, 1, 1, 0, 1, 1, 2, 2, 0, 1, 3, 0, 1, 3, 4, 0, 2, 1, 3, 2, 1, 3, 6, 2, 0, 3, 3, 0, 3, 3, 6, 2, 0, 3, 7, 0, 1, 5, 6, 0, 2, 1, 5, 4, 3, 5, 10, 4, 2, 3, 3, 0, 3, 5, 8, 2, 0, 3, 9, 0, 3, 7, 10, 0, 2, 1, 5, 4, 3, 7, 12, 0, 0, 7, 5, 2, 5, 5, 12, 6, 0, 3, 9, 0, 1, 7, 8, 0, 4, 3, 7, 4, 5, 9, 16, 0, 4
OFFSET
2,7
COMMENTS
a(n) = 0 when n = 2, any prime of the form 4k+1 with k >= 1 and any product of these without repetition, e.g. 2x5x17.
LINKS
FORMULA
a(n) = A166375(n) - A128422(n).
MATHEMATICA
Table[Sum[Floor[k^2/n], {k, 1, n - 1}] - Floor[(n - 1)*(n - 2)/3], {n, 2, 100}] (* G. C. Greubel, May 12 2016 *)
PROG
(PARI) a(n) = sum(j=1, n-1, j^2\n) - ((n-1)*(n-2))\3 \\ Michel Marcus, Jun 21 2013
CROSSREFS
Sequence in context: A303548 A105524 A221459 * A000209 A359901 A170982
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected and enhanced by Christopher Hunt Gribble, Dec 01 2009
STATUS
approved