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.

This page as a plain text file.
%I A376480 #9 Sep 27 2024 23:13:23
%S A376480 1,3,6,8,15,24,68,68,103,179,280,432,681,1078,1705,2630,4110,6414,
%T A376480 10029,15611,24297,37746,58506,90631,140203,216630,334543,516159,
%U A376480 795637,1225649,1886573,2901816,4460387,6851543,10518523,16138688
%N 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.
%C A376480 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, ...
%e A376480 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.
%p A376480 f:= proc(n)
%p A376480 uses priqueue;
%p A376480  local pq, t, s, count,v, w, p, i;
%p A376480  initialize(pq);
%p A376480  insert([-2^n, [2$n]],pq);
%p A376480  s:= 0;
%p A376480  for count from 1 do
%p A376480    t:= extract(pq);
%p A376480    v:= -t[1];
%p A376480    w:= t[2];
%p A376480    s:= s+v;
%p A376480    if isprime(s) then return count fi;
%p A376480    p:= nextprime(w[-1]);
%p A376480    for i from n to 1 by -1 while w[i] = w[n] do
%p A376480       insert([t[1]*(p/w[-1])^(n+1-i),[op(w[1..i-1]),p$(n+1-i)]],pq);
%p A376480  od od;
%p A376480 end proc:
%p A376480 map(f, [$1..36]);
%Y A376480 Cf. A001222, A078843, A376481.
%K A376480 nonn
%O A376480 1,2
%A A376480 _Robert Israel_, Sep 24 2024