OFFSET
1,6
COMMENTS
First occurrence of k: 1, 6, 21, 20, 55, 42, 203, 120, 171, 110, 253, 84, 689, 406, 465, 272, 1751, 342, 3629, 220, ..., . - Robert G. Wilson v
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
EXAMPLE
The distinct primes that divide 20 are 2 and 5. So a(20) = gcd(20, (2-1)(5-1)) = gcd(20,4) = 4.
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 *)
PROG
(PARI)
A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 15 2007
EXTENSIONS
More terms from Emeric Deutsch, Apr 11 2007
STATUS
approved