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.

A109015 a(n) = gcd(n,12).

Original entry on oeis.org

12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2
Offset: 0

Views

Author

Keywords

Comments

Periodic, with period = 12. - Harvey P. Dale, Dec 20 2018

Crossrefs

Cf. A109004.

Programs

  • Mathematica
    GCD[Range[0,100],12] (* or *) PadRight[{},120,{12,1,2,3,4,1,6,1,4,3,2,1}] (* Harvey P. Dale, Dec 20 2018 *)
  • Python
    from math import gcd
    def a(n): return gcd(n, 12)
    print([a(n) for n in range(99)]) # Michael S. Branicky, Dec 01 2021

Formula

a(n) = 1 + [2|n] + 2*[3|n] + 2*[4|n] + 2*[6|n] + 4*[12|n], where [x|y] = 1 when x divides y, 0 otherwise.
a(n) = a(n-12).
Multiplicative with a(p^e, 12) = gcd(p^e, 12). - David W. Wilson, Jun 12 2005
Dirichlet g.f.: zeta(s)*(1 + 1/2^s + 2/4^s)*(1 + 2/3^s). - R. J. Mathar, Apr 08 2011