login
A195938
a(n) = n/2 if n mod 4 = 2, 0 otherwise.
2
0, 1, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 13, 0, 0, 0, 15, 0, 0, 0, 17, 0, 0, 0, 19, 0, 0, 0, 21, 0, 0, 0, 23, 0, 0, 0, 25, 0, 0, 0, 27, 0, 0, 0, 29, 0, 0, 0, 31, 0, 0, 0, 33, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 0, 39
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
Odd numbers A005408, with 3 zeros between them. - T. D. Noe, Oct 27 2011
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
Sequence in context: A293381 A118112 A245552 * A184762 A330734 A081805
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Oct 26 2011
STATUS
approved