A109012 a(n) = gcd(n,9).
9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..100000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,1).
Crossrefs
Programs
-
Mathematica
GCD[Range[0, 100], 9] (* Paolo Xausa, Aug 28 2024 *)
-
PARI
a(n)=gcd(n,9) \\ Charles R Greathouse IV, Oct 07 2015
-
Python
from math import gcd def a(n): return gcd(n, 9) print([a(n) for n in range(101)]) # Michael S. Branicky, Sep 01 2021
Formula
a(n) = 1 + 2*[3|n] + 6*[9|n], where [x|y] = 1 when x divides y, 0 otherwise.
a(n) = a(n-9).
Multiplicative with a(p^e, 9) = gcd(p^e, 9). - David W. Wilson, Jun 12 2005
G.f.: (-9 - x - x^2 - 3*x^3 - x^4 - x^5 - 3*x^6 - x^7 - x^8) / ((x-1)*(1 + x + x^2)*(x^6 + x^3 + 1)). - R. J. Mathar, Apr 04 2011
Dirichlet g.f.: (1+2/3^s+6/9^s)*zeta(s). - R. J. Mathar, Apr 04 2011
Comments