login
A082067
Smallest prime that divides n and phi(n)=A000010(n), or 1 if n and phi(n) are relatively prime.
7
1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 5, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 7, 2, 1, 2, 1, 2, 5, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3
OFFSET
1,4
LINKS
FORMULA
a(n) = A020639(A009195(n)). - Antti Karttunen, Nov 03 2017
MATHEMATICA
ffi[x_] := Flatten[FactorInteger[x]]; lf[x_] := Length[FactorInteger[x]]; ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}]; f1[x_] := n; f2[x_] := EulerPhi[x]; Table[Min[Intersection[ba[f1[w]], ba[f2[w]]]], {w, 1, 128}]
(* Second program: *)
Array[If[CoprimeQ[#1, #2], 1, Min@ Apply[Intersection, Map[FactorInteger[#][[All, 1]] &, {#1, #2}]]] & @@ {#, EulerPhi@ #} &, 105] (* Michael De Vlieger, Nov 03 2017 *)
PROG
(PARI)
A020639(n) = if(1==n, n, vecmin(factor(n)[, 1]));
A082067(n) = A020639(gcd(eulerphi(n), n)); \\ Antti Karttunen, Nov 03 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 07 2003
EXTENSIONS
Name clarified by Antti Karttunen, Nov 03 2017
STATUS
approved