OFFSET
1,6
COMMENTS
If S(j,n) = Sum_{k=1..n} k^j then, for any odd j, S(j,n) mod n = a(n). - Gary Detlefs, Oct 26 2011
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
FORMULA
Euler transform of length 8 sequence [ 0, 0, 0, 3, 0, 0, 0, -1]. - Michael Somos, Oct 29 2011
a(n) = -a(-n) for all n in Z. - Michael Somos, Oct 29 2011
a(n) = (Sum_{k=1..n} k^(2*j-1)) mod n, for any j.
a(n) = (n/2)*floor((1/2)*cos((n+2)*Pi/2) + 1/2).
G.f.: (1+x^4)*x^2/(1-x^4)^2. - Philippe Deléham, Oct 27 2011
a(n) = binomial(n^2,3)/4 mod n. - Gary Detlefs, May 04 2013
a(n) = n*(1 - i^n)*(1 + i^(2*n))/8, where i=sqrt(-1). - Ammar Khatab, Aug 25 2020
EXAMPLE
G.f. = x + 3*x^5 + 5*x^9 + 7*x^13 + 9*x^17 + 11*x^21 + 13*x^25 + ...
MAPLE
S:=(j, n)-> sum(k^j, k=1..n):seq(S(3, n) mod n, n=1..70);
MATHEMATICA
a[n_] := If[Mod[n, 4] == 2, n/2, 0]; Table[a[n], {n, 80}] (* Alonso del Arte, Oct 26 2011 *)
PROG
(PARI) a(n)=if(n%4==2, n/2) \\ Charles R Greathouse IV, Oct 26 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Oct 26 2011
STATUS
approved