login
Numbers k such that the sum of the least prime factors of i=2..k is prime.
1

%I #45 Jul 09 2022 06:53:32

%S 2,3,4,8,12,15,16,20,24,40,43,52,55,60,63,68,72,79,87,95,96,108,111,

%T 120,123,136,140,148,151,160,184,211,215,216,227,232,235,239,252,255,

%U 256,260,264,280,283,288,299,307,323,324,327,332,360,363,371,372,375,379

%N Numbers k such that the sum of the least prime factors of i=2..k is prime.

%H Jean-Marc Rebert, <a href="/A355441/b355441.txt">Table of n, a(n) for n = 1..5676</a>

%e 8 is a term since the least prime factors of 2..8 are 2, 3, 2, 5, 2, 7, 2 and their sum 23 is prime.

%t Position[Accumulate[Join[{0}, Table[FactorInteger[k][[1, 1]], {k, 2, 400}]]], _?PrimeQ] // Flatten (* _Amiram Eldar_, Jul 02 2022 *)

%o (Python)

%o from sympy import isprime, factorint

%o from itertools import accumulate, count, islice

%o def agen(): yield from (k for k, sk in enumerate(accumulate(min(factorint(i)) for i in count(2)), 2) if isprime(sk))

%o print(list(islice(agen(), 75))) # _Michael S. Branicky_, Jul 02 2022

%o (PARI) isok(k) = isprime(sum(i=2, k, factor(i)[1,1])); \\ _Michel Marcus_, Jul 04 2022

%Y Cf. A088821.

%K nonn

%O 1,1

%A _Jean-Marc Rebert_, Jul 02 2022