[go: up one dir, main page]

login
A089146
Greatest common divisor of n^2 - 4 and n^2 + 4.
1
4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4, 1, 8, 1, 4
OFFSET
0,1
COMMENTS
Also decimal expansion of 4181/9999 = 0.418141814181...
Repeat [4,1,8,1], because for odd n, the GCD is 1; for n = 4k+2, GCD(16(k^2+k), 16(k^2+k)+8) = 8; for n = 4k, (16k^2-4,16k^2+4) can be divided by 4, but then GCD(4k^2-1,4k^2+1) = 1. - Georg Fischer, Jul 21 2022
FORMULA
Multiplicative with a(2) = 8, a(2^e) = 4 if e >= 2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
Dirichlet g.f.: zeta(s)*(1+7/2^s-4^(1-s)). - Amiram Eldar, Dec 31 2022
Sum_{k=1..n} a(k) ~ 7*n/2. - Vaclav Kotesovec, Dec 31 2022
MATHEMATICA
a[n_] := GCD[n^2 - 4, n^2 + 4]; Array[a, 101, 0] (* Amiram Eldar, Dec 31 2022 *)
PROG
(PARI) g(n) = for(x=0, n, print1(gcd(x^2-4, x^2+4)", "))
CROSSREFS
Sequence in context: A084884 A329998 A143320 * A297402 A239666 A101512
KEYWORD
easy,nonn,mult
AUTHOR
Cino Hilliard, Dec 05 2003
STATUS
approved