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.

A373630 a(n) is the n-th semiprime after the n-th prime.

This page as a plain text file.
%I A373630 #20 Jul 23 2024 14:59:04
%S A373630 4,6,10,15,25,26,35,38,49,57,58,74,85,86,91,95,118,119,123,133,134,
%T A373630 143,146,161,183,185,187,201,202,205,218,221,237,247,265,267,278,295,
%U A373630 299,302,309,314,326,327,334,335,362,393,395,398,403,413,415,427,446,453,466,469,473,481,482,497,519
%N A373630 a(n) is the n-th semiprime after the n-th prime.
%H A373630 Robert Israel, <a href="/A373630/b373630.txt">Table of n, a(n) for n = 1..10000</a>
%F A373630 a(n) = A001358(n + A072000(A000040(n))).
%e A373630 a(5) = 25 because the 5th prime is 11 and the first 5 semiprimes > 11 are 14,15,21,22,25.
%p A373630 N:= 10^4: # for terms <= N
%p A373630 P:= select(isprime,[2,seq(i,i=3..N,2)]):
%p A373630 S:= select(t -> numtheory:-bigomega(t)=2, [$1..N]): nS:= nops(S):
%p A373630 f:= proc(n) local j;
%p A373630   j:= ListTools:-BinaryPlace(S,P[n]);
%p A373630   if j + n <= nS then S[j+n] else fail fi
%p A373630 end proc:
%p A373630 R:= NULL:
%p A373630 for i from 1 do
%p A373630   v:= f(i);
%p A373630   if v = fail then break fi;
%p A373630   R:= R,v
%p A373630 od:
%p A373630 R;
%t A373630 seq={};Do[i=Prime[n]+1;cnt=0;While[cnt<n,If[PrimeOmega[i]==2,cnt++];i++]; AppendTo[seq,i-1],{n,63}];seq (* _James C. McMahon_, Jun 15 2024 *)
%o A373630 (Python)
%o A373630 from math import isqrt
%o A373630 from sympy import primepi, prime
%o A373630 def A373630(n):
%o A373630     p = prime(n)
%o A373630     q = n+int(sum(primepi(p//prime(k))-k+1 for k in range(1,primepi(isqrt(p))+1)))
%o A373630     def f(x): return int(q+x-sum(primepi(x//prime(k))-k+1 for k in range(1, primepi(isqrt(x))+1)))
%o A373630     m, k = q, f(q)
%o A373630     while m != k:
%o A373630         m, k = k, f(k)
%o A373630     return m # _Chai Wah Wu_, Jul 23 2024
%Y A373630 Cf. A000040, A001358, A072000.
%K A373630 nonn
%O A373630 1,1
%A A373630 _Zak Seidov_ and _Robert Israel_, Jun 11 2024