|
|
A215573
|
|
a(n) = n*(n+1)*(2n+1)/6 modulo n.
|
|
3
|
|
|
0, 1, 2, 2, 0, 1, 0, 4, 6, 5, 0, 2, 0, 7, 10, 8, 0, 3, 0, 10, 14, 11, 0, 4, 0, 13, 18, 14, 0, 5, 0, 16, 22, 17, 0, 6, 0, 19, 26, 20, 0, 7, 0, 22, 30, 23, 0, 8, 0, 25, 34, 26, 0, 9, 0, 28, 38, 29, 0, 10, 0, 31, 42, 32, 0, 11, 0, 34, 46, 35, 0, 12, 0, 37, 50, 38
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
a(n) = 0 for n = 6k +- 1, that is, A007310 (numbers congruent to 1 or 5 mod 6).
Graph consists of 4 linear patterns.
|
|
LINKS
|
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,2,0,0,0,0,0,-1).
|
|
FORMULA
|
G.f.: x^2*(1 + 2*x + 2*x^2 + x^4 + 2*x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-6) - a(n-12) for n>12. (End)
a(6*n) = n, a(6*n+1) = 0, a(6*n+2) = 3*n+1, a(6*n+3) = 4*n+2, a(6*n+4) = 3*n+2, a(6*n+5) = 0. - Philippe Deléham, Mar 05 2023
|
|
MAPLE
|
seq(modp(n*(n+1)*(2*n+1)/6, n), n=1..100); # Muniru A Asiru, Feb 07 2019
|
|
MATHEMATICA
|
Table[Mod[(n(n+1)(2n+1))/6, n], {n, 80}] (* or *) LinearRecurrence[{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, -1}, {0, 1, 2, 2, 0, 1, 0, 4, 6, 5, 0, 2}, 80] (* Harvey P. Dale, Aug 25 2023 *)
|
|
PROG
|
(PARI) concat(0, Vec(x^2*(1 + 2*x + 2*x^2 + x^4 + 2*x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2) + O(x^80))) \\ Colin Barker, Feb 07 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|