login
a(n) = gcd(sum of all prime factors of n, n).
4

%I #15 Oct 18 2019 23:01:49

%S 1,2,3,2,5,1,7,2,3,1,11,1,13,1,1,2,17,1,19,1,1,1,23,1,5,1,3,1,29,10,

%T 31,2,1,1,1,1,37,1,1,1,41,6,43,1,1,1,47,1,7,1,1,1,53,1,1,1,1,1,59,10,

%U 61,1,1,2,1,2,67,1,1,14,71,1,73,1,1,1,1,6,79,1,3,1,83,12,1,1,1,1,89,10,1,1,1

%N a(n) = gcd(sum of all prime factors of n, n).

%C a(n) = n iff n is prime. - _Robert Israel_, Mar 29 2015

%H Robert Israel, <a href="/A099635/b099635.txt">Table of n, a(n) for n = 1..10000</a>

%e a(25) = gcd(5,25) = 5.

%p seq(igcd(n, convert(numtheory:-factorset(n),`+`)), n = 1 .. 1000); # _Robert Israel_, Mar 29 2015

%t PrimeFactors[n_Integer] := Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]; f[n_] := GCD[Plus @@ PrimeFactors[n], n]; Table[ f[n], {n, 93}] (* _Robert G. Wilson v_, Nov 04 2004 *)

%Y Cf. A099634, A099636.

%K nonn

%O 1,2

%A _Labos Elemer_, Oct 28 2004