|
|
A089128
|
|
a(n) = gcd(6,n).
|
|
16
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Also greatest common divisor of n^2-6 and n^2+6.
The second term of sequences of this type for n=0,1,2... form the sequence 1,2,1,2,1,... in decimal 0.1212121212... = 4/33.
a(n) = denominators of averages of squares of the first n positive integers for n >= 1.
a(n) is periodic sequence with period (6, 1, 2, 3, 2, 1).
See A175485 - numerators of averages of squares of the first n positive integers.
For n = 337 holds: a(n) = 1 and simultaneously A175485(n) is square ( = 38025 = 195^2), i.e., the number k = 195 is quadratic mean (root mean square) of the first 337 positive integers. There are other such numbers - see A084231 and A084232.
Sqrt(A175485(n) / a(n)) for n >= 1 is the harmonic mean of the first n positive integers. (End)
|
|
LINKS
|
|
|
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
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
|
|
MATHEMATICA
|
GCD[Range[0, 110], 6] (* or *) PadRight[{}, 110, {6, 1, 2, 3, 2, 1}] (* Harvey P. Dale, Dec 26 2018 *)
|
|
PROG
|
(PARI) g(n) = for(x=0, n, print1(gcd(x^2-6, x^2+6)", "))
(Haskell)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|