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.

A376480 a(n) is the least k such that the sum of the first k numbers with n prime factors, counted with multiplicity, is prime.

Original entry on oeis.org

1, 3, 6, 8, 15, 24, 68, 68, 103, 179, 280, 432, 681, 1078, 1705, 2630, 4110, 6414, 10029, 15611, 24297, 37746, 58506, 90631, 140203, 216630, 334543, 516159, 795637, 1225649, 1886573, 2901816, 4460387, 6851543, 10518523, 16138688
Offset: 1

Views

Author

Robert Israel, Sep 24 2024

Keywords

Comments

For n >=2, a(n) >= A078843(n), as for k < A078843(n) the sum of the first k is even. a(n) = A078843(n) for n = 2, 4, 9, 18, ...

Examples

			a(3) = 6 because the sum of the first 6 triprimes is 8 + 12 + 18 + 20 + 27 + 28 = 113 which is prime, and none of the previous partial sums is prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n)
    uses priqueue;
     local pq, t, s, count,v, w, p, i;
     initialize(pq);
     insert([-2^n, [2$n]],pq);
     s:= 0;
     for count from 1 do
       t:= extract(pq);
       v:= -t[1];
       w:= t[2];
       s:= s+v;
       if isprime(s) then return count fi;
       p:= nextprime(w[-1]);
       for i from n to 1 by -1 while w[i] = w[n] do
          insert([t[1]*(p/w[-1])^(n+1-i),[op(w[1..i-1]),p$(n+1-i)]],pq);
     od od;
    end proc:
    map(f, [$1..36]);