A166387 a(n) = sum (floor (j^2/n), 1 <= j <= n-1) - floor ((n-1)(n-2)/3), n >= 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
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 2..10000
Programs
-
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 *)
-
PARI
a(n) = sum(j=1,n-1, j^2\n) - ((n-1)*(n-2))\3 \\ Michel Marcus, Jun 21 2013
Extensions
Corrected and enhanced by Christopher Hunt Gribble, Dec 01 2009
Comments