A089146 Greatest common divisor of n^2 - 4 and n^2 + 4.
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
Programs
-
Mathematica
a[n_] := GCD[n^2 - 4, n^2 + 4]; Array[a, 101, 0] (* Amiram Eldar, Dec 31 2022 *)
-
PARI
g(n) = for(x=0,n,print1(gcd(x^2-4,x^2+4)","))
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
Comments