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.

A109008 a(n) = gcd(n,4).

Original entry on oeis.org

4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4
Offset: 0

Views

Author

Keywords

Comments

Period 4: repeat [4, 1, 2, 1]. - Wesley Ivan Hurt, Aug 31 2014

Crossrefs

Cf. A109004.

Programs

Formula

a(n) = 1 + [2|n] + 2*[4|n] = 2 + (-1)^n + cos(n*Pi/2), where [x|y] = 1 when x divides y, 0 otherwise.
a(n) = a(n-4) for n>3.
Multiplicative with a(p^e) = gcd(p^e, 4). - David W. Wilson, Jun 12 2005
Dirichlet g.f.: (1 + 1/2^s + 2/4^s)*zeta(s). - R. J. Mathar, Feb 28 2011
G.f.: (4+x+2*x^2+x^3)/((1-x)*(1+x)*(1+x^2)). - R. J. Mathar, Apr 04 2011
a(n) = 1 + mod((n-1)^3, 4). - Wesley Ivan Hurt, Aug 31 2014
a(n) = 2 + cos(n*Pi) + cos(n*Pi/2). - Wesley Ivan Hurt, Jul 07 2016
E.g.f.: exp(-x) + 2*exp(x) + cos(x). - Ilya Gutkovskiy, Jul 07 2016