A089128 a(n) = gcd(6,n).
6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1)
Programs
-
Haskell
a089128 = gcd 6 -- Reinhard Zumkeller, Apr 06 2015
-
Mathematica
GCD[Range[0,110],6] (* or *) PadRight[{},110,{6,1,2,3,2,1}] (* Harvey P. Dale, Dec 26 2018 *)
-
PARI
g(n) = for(x=0,n,print1(gcd(x^2-6,x^2+6)","))
Formula
a(n) = 1 + [2|n] + 2*[3|n] + 2*[6|n] = (15 + 5*(-1)^n + 4*cos(n*Pi/3) + 12*cos(n*2*Pi/3))/6, where [x|y] is 1 if x divides y, 0 otherwise. - Mitch Harris Jun 15 2005
From R. J. Mathar, Apr 04 2011: (Start)
Dirichlet g.f.: zeta(s)*(1+1/2^s+2/3^s+2/6^s).
G.f.: (-6 - x - 2*x^2 - 3*x^3 - 2*x^4 - x^5) / ((x-1)*(1+x)*(1 + x + x^2)*(x^2 - x + 1)). (End)
a(n) = ((n-1) mod 2 + 1)*( 2*floor(((n-1) mod 3)/2) + 1). - Gary Detlefs, Dec 28 2011
Extensions
Name changed, using David W. Wilson's formula, by Franklin T. Adams-Watters, May 16 2018
Comments