%I #42 Apr 15 2018 03:38:44
%S 4,8,6,10,28,22,52,34,76,184,58,213,148,82,172,309,424,118,393,268,
%T 142,584,316,664,573,388,202,412,214,436,753,508,813,274,1465,298,933,
%U 974,652,1336,1384,358,1137,382,772,394,1257,1329,892,454,916,1864,478,1497,1538,1569
%N a(n) is the smallest composite number whose sum of prime divisors (with multiplicity) is divisible by prime(n).
%C In most cases a(n) = A288814(prime(n)) but there are exceptions, e.g., a(37)=213, whereas A288814(37)=248. Other exceptions include a(53), a(67), a(127), a(137), etc. These examples occur when there is a number r such that A001414(r*p) is less than A288814(p).
%C The strictly increasing subsequence of terms (10, 22, 34, 58, 82, 118, 142, 202, 214, 274, 298, ...) where for all m>n, a(m)>a(n) gives the semiprimes with prime sum of prime factors, A108605. The sequence of the indices of this subsequence (5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, ...) gives the greater of twin primes, A006512.
%H Charles R Greathouse IV, <a href="/A288189/b288189.txt">Table of n, a(n) for n = 1..10000</a>
%e a(5)=6 because 6 = 2*3 is the smallest number whose sum of prime divisors (2+3 = 5) is divisible by 5.
%e a(37) = 213 = A288814(74) = A288814(2*37).
%t With[{s = Array[Boole[CompositeQ@ #] Total@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger@ #] &, 10^4] /. 0 -> ""}, Table[FirstPosition[s, _?(Mod[#, p] == 0 &)][[1]], {p, Prime@ Range@ 56}]] (* _Michael De Vlieger_, Apr 14 2018 *)
%o (PARI) sopfr(k) = my(f=factor(k)); sum(j=1, #f~, f[j, 1]*f[j, 2]);
%o a(n) = my(pn=prime(n)); forcomposite(c=pn, , if (sopfr(c) % pn == 0, return(c))); \\ _Michel Marcus_, Jul 03 2017
%Y Cf. A000040, A001414, A006512, A056240, A108605, A288814.
%K nonn
%O 1,1
%A _David James Sycamore_, Jul 01 2017