login
Greatest common divisor of n^2 - 4 and n^2 + 4.
1

%I #26 Dec 31 2022 03:56:35

%S 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,

%T 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,

%U 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

%N Greatest common divisor of n^2 - 4 and n^2 + 4.

%C Also decimal expansion of 4181/9999 = 0.418141814181...

%C 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

%F Multiplicative with a(2) = 8, a(2^e) = 4 if e >= 2, a(p^e) = 1 otherwise. - _David W. Wilson_, Jun 12 2005

%F Dirichlet g.f.: zeta(s)*(1+7/2^s-4^(1-s)). - _Amiram Eldar_, Dec 31 2022

%F Sum_{k=1..n} a(k) ~ 7*n/2. - _Vaclav Kotesovec_, Dec 31 2022

%t a[n_] := GCD[n^2 - 4, n^2 + 4]; Array[a, 101, 0] (* _Amiram Eldar_, Dec 31 2022 *)

%o (PARI) g(n) = for(x=0,n,print1(gcd(x^2-4,x^2+4)","))

%Y Cf. A028347, A087475.

%K easy,nonn,mult

%O 0,1

%A _Cino Hilliard_, Dec 05 2003