cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A195938 a(n) = n/2 if n mod 4 = 2, 0 otherwise.

Original entry on oeis.org

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

Views

Author

Gary Detlefs, Oct 26 2011

Keywords

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

Examples

			G.f. = x + 3*x^5 + 5*x^9 + 7*x^13 + 9*x^17 + 11*x^21 + 13*x^25 + ...
		

Programs

  • 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 *)
  • PARI
    a(n)=if(n%4==2,n/2) \\ Charles R Greathouse IV, Oct 26 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