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
Zak Seidov, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,2,0,0,0,0,0,-1).
FORMULA
a(n) = A000330(n) mod n.
From Colin Barker, Feb 07 2019: (Start)
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
a(n) = A048153(n) mod n. - Alois P. Heinz, Jun 03 2024
a(n) = A000330(n-1) mod n. - Chai Wah Wu, Jun 03 2024
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) a(n)=n*(n+1)*(2*n+1)/6 % n; \\ Michel Marcus, Oct 19 2013
(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
(Python)
def A215573(n): return n*(n-1)*((n<<1)-1)//6%n # Chai Wah Wu, Jun 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Aug 16 2012
STATUS
approved