%I #16 Nov 22 2021 10:10:13
%S 18,24,25,46,57,161,203,209,288,319,323,391,736,798,837,858,928,930,
%T 1035,1088,1089,1218,1300,1376,1690,2254,2418,2478,2673,2842,2871,
%U 3045,3220,3325,3458,3510,3588,4186,4508,4617,4824,5054,5180,5248,5472,6069
%N Iterated procedure 'composite k added to sum of its prime factors reaches a prime' yields 5 skipped primes.
%H Robert Israel, <a href="/A050772/b050772.txt">Table of n, a(n) for n = 1..1000</a>
%e 18 is a term because 18 + (2+3+3) = 26 + (2+13) = ending prime 41. Between 18 and 41 one finds 5 primes 19, 23, 29, 31 and 37.
%p filter:= proc(n) local r, s, t;
%p if isprime(n) then return false fi;
%p t:= 0: s:= n;
%p do
%p r:= s;
%p s:= s + add(p[1]*p[2],p=ifactors(s)[2]);
%p t:= t + numtheory:-pi(s-1) - numtheory:-pi(r);
%p if isprime(s) then return t=5 fi;
%p if t > 5 then return false fi;
%p od;
%p end proc:
%p select(filter, [$2..10000]); # _Robert Israel_, May 08 2020
%t ok[n_] := CompositeQ[n] && Block[{k=n, p = NextPrime[n, 6]}, While[k < p, k += Total[ Times @@@ FactorInteger[k]]]; k == p]; Select[Range@ 6069, ok] (* _Giovanni Resta_, May 08 2020 *)
%Y Cf. A050703, A050710.
%K nonn
%O 1,1
%A _Patrick De Geest_, Sep 15 1999
%E Offset changed to 1 by _Robert Israel_, May 08 2020
|