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.

A138191 Denominator of (n-1)*n*(n+1)/12.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1
Offset: 1

Views

Author

Eric W. Weisstein, Mar 04 2008

Keywords

Comments

Proof of 4-periodicity follows from evaluating (n+3)(n+4)(n+5)/12, subtracting (n-1)n(n+1)/12 and getting n^2+4n+5 which is an integer. - R. J. Mathar, Mar 07 2008

Examples

			0, 1/2, 2, 5, 10, 35/2, 28, 42, 60, 165/2, 110, 143, 182, ...
		

Crossrefs

Programs

  • Mathematica
    Table[(n^3-n)/12,{n,120}]//Denominator (* or *) PadRight[{},120,{1,2,1,1}] (* Harvey P. Dale, Apr 15 2019 *)
  • Python
    def A138191(n): return (1,1,2,1)[n&3] # Chai Wah Wu, Apr 25 2024

Formula

From R. J. Mathar, Mar 07 2008: (Start)
a(n) = 1 + (A000292(n-1) mod 2) = a(n-4).
O.g.f.: -1-5/(4(x-1))+1/(4(x+1))-1/(2(x^2+1)). (End)
From Amiram Eldar, Jan 01 2023: (Start)
Multiplicative with a(p^e) = 2 if p = 2 and e = 1, and 1 otherwise.
Dirichlet g.f.: zeta(s)*(1+1/2^s-1/4^s).
Sum_{k=1..n} a(k) ~ (5/4)*n. (End)