login
Greatest common prime divisor of n and sigma_2(n) = A001157(n), or 1 if the two are relatively prime.
6

%I #24 Nov 06 2017 02:48:42

%S 1,1,1,1,1,2,1,1,1,5,1,3,1,2,5,1,1,1,1,2,1,2,1,2,1,2,1,7,1,5,1,1,1,2,

%T 5,3,1,2,1,5,1,2,1,2,1,2,1,2,1,5,1,2,1,2,1,2,1,2,1,5,1,2,7,1,13,2,1,2,

%U 1,5,1,1,1,2,5,2,1,2,1,2,1,2,1,7,5,2,1,2,1,5,1,2,1,2,1,3,1,1,1,1,1,2,1,2,5

%N Greatest common prime divisor of n and sigma_2(n) = A001157(n), or 1 if the two are relatively prime.

%H Charles R Greathouse IV, <a href="/A082063/b082063.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A006530(A179930(n)). - _Antti Karttunen_, Nov 03 2017

%t (* factors/exponent SET *) 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_] := x; f2[x_] := DivisorSigma[2, x]; Table[Max[Intersection[ba[f1[w]], ba[f2[w]]]], {w, 1, 128}]

%t (* Second program: *)

%t Array[If[CoprimeQ[#1, #2], 1, Max@ Apply[Intersection, Map[FactorInteger[#][[All, 1]] &, {#1, #2}]]] & @@ {#, DivisorSigma[2, #]} &, 105] (* _Michael De Vlieger_, Nov 03 2017 *)

%o (PARI)

%o A006530(n) = if(1==n, n, vecmax(factor(n)[, 1]));

%o A082063(n) = A006530(gcd(sigma(n,2), n)); \\ _Antti Karttunen_, Nov 03 2017

%Y Cf. A006530, A001157, A179930.

%Y Cf. also A082061, A082062, A082064, A082065, A082066, A082069.

%K nonn

%O 1,6

%A _Labos Elemer_, Apr 07 2003

%E Erroneous comment removed by _Antti Karttunen_, Nov 03 2017