cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385997 a(n) is the smallest k such that the sum of the first k primes has exactly n prime factors, counting multiplicity.

Original entry on oeis.org

1, 3, 5, 9, 17, 11, 103, 119, 475, 237, 2661, 1481, 3045, 1567, 22019, 34907, 24995, 28173, 4915, 269225, 214183, 927571, 1085315, 9724983, 2567053, 4620383, 8827803, 38175467, 37167809, 98773463, 153124063, 257222427, 370283099, 24322477, 592786617
Offset: 1

Views

Author

Felix Huber, Jul 27 2025

Keywords

Comments

a(n) is the smallest k such that A001222(A007504(k)) = A102862(k) = n.
a(34) = 24322477. - Robert Israel, Jul 29 2025

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

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