OFFSET
1,2
COMMENTS
a(34) = 24322477. - Robert Israel, Jul 29 2025
EXAMPLE
a(2) = 3, because the sum of the first three primes 2 + 3 + 5 = 10 = 2*5 has exactly 2 prime factors. The sums of the first 1 or 2 primes (2 or 2 + 3 = 5) have only one prime factor.
a(5) = 17, because the sum of the first 17 primes (440 = 2^3*5*11) has exactly 5 prime factors. The sums of the first 1, 2, ..., 16 primes have either fewer or more than 5 prime factors.
MAPLE
M:= 29: # for a(1) .. a(M)
V:= Vector(M):
t:= 0: p:= 1: count:= 0:
for i from 1 while count < M do
p:= nextprime(p);
t:= t + p;
v:= numtheory:-bigomega(t);
if v <= M and V[v] = 0 then V[v]:= i; count:= count+1 fi
od:
convert(V, list); # Robert Israel, Jul 29 2025
MATHEMATICA
a[n_]:=Module[{k=1, ps=0}, Until[PrimeOmega[ps]==n, ps=ps+Prime[k]; k++]; k-1]; Array[a, 20] (* James C. McMahon, Aug 05 2025 *)
PROG
(Python)
from itertools import count
from sympy import factorint, nextprime
def A385997(n):
p, c = 2, 0
for k in count(1):
c += p
if sum(factorint(c).values())==n:
return k
p = nextprime(p) # Chai Wah Wu, Aug 08 2025
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Felix Huber, Jul 27 2025
EXTENSIONS
a(23)-a(30) from Robert Israel, Jul 29 2025
a(31) from Sean A. Irvine, Aug 05 2025
a(32)-a(34) from Chai Wah Wu, Aug 08 2025
a(35) from Chai Wah Wu, Sep 01 2025
STATUS
approved
