A126864 a(n) = gcd(n, Product_{p|n} (p-1)), where the product is over the distinct primes, p, that divide n.
1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 4, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 6, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 5, 2, 3, 2, 1, 4, 1, 2, 3, 1, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 1, 6, 1, 4, 1, 2, 1, 12, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 3
Offset: 1
Keywords
Examples
The distinct primes that divide 20 are 2 and 5. So a(20) = gcd(20, (2-1)(5-1)) = gcd(20,4) = 4.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Maple
with(numtheory): a:=n->gcd(n,product(factorset(n)[i]-1,i=1..nops(factorset(n)))); # Emeric Deutsch, Apr 11 2007
-
Mathematica
f[n_] := GCD[n, Times @@ (First /@ FactorInteger[n] - 1)]; Array[f, 105] (* Robert G. Wilson v, Sep 08 2007 *)
-
PARI
A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1])); A126864(n) = gcd(n, A173557(n)); \\ Antti Karttunen, Sep 17 2018
Formula
Extensions
More terms from Emeric Deutsch, Apr 11 2007
Comments