A126865 a(n) = gcd(Product_{p|n} (p+1)^b(p,n), Product_{p|n} (p-1)^b(p,n)), where the products are over the distinct primes, p, that divide n and p^b(p,n) is the highest power of p dividing n.
1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 2, 2, 2, 6, 8, 1, 2, 4, 2, 2, 4, 2, 2, 2, 4, 6, 8, 6, 2, 8, 2, 1, 4, 2, 24, 4, 2, 6, 8, 2, 2, 12, 2, 2, 16, 2, 2, 2, 4, 4, 8, 6, 2, 8, 8, 6, 4, 2, 2, 8, 2, 6, 8, 1, 12, 4, 2, 2, 4, 24, 2, 4, 2, 6, 16, 18, 12, 24, 2, 2, 16, 2, 2, 12, 4, 6, 8, 2, 2, 16, 8, 2, 4, 2, 24, 2, 2, 12, 8
Offset: 1
Keywords
Examples
400 = 2^4 * 5^2. So a(400) = gcd((2+1)^4 * (5+1)^2, (2-1)^4 * (5-1)^2) = gcd(2916, 16) = 4.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..12441
- Antti Karttunen, Data supplement: n, a(n) computed for n = 1..100000
Programs
-
Mathematica
f[n_] := Block[{fi = FactorInteger@n}, GCD[Times @@ ((First /@ fi - 1)^Last /@ fi), Times @@ ((First /@ fi + 1)^Last /@ fi)]]; Array[f, 99] (* Robert G. Wilson v, Sep 08 2007 *)
-
PARI
A003958(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]--); factorback(f); }; A003959(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]++); factorback(f); }; A126865(n) = gcd(A003958(n),A003959(n)); \\ Antti Karttunen, Dec 17 2018
Formula
From Antti Karttunen, Dec 17 2018: (Start)
(End)
Extensions
More terms from Robert G. Wilson v, Sep 08 2007
Comments