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.

A365222 a(n) is the least semiprime such that a(n) - n and a(n) + n are the previous and the next semiprimes.

This page as a plain text file.
%I A365222 #6 Aug 27 2023 02:04:23
%S A365222 34,185,262,407,314,371,194,2271,6218,4237,109898,110645,53602,169773,
%T A365222 112298,163985,284738,48529,1033378,1781833,570502,1963091,12527458,
%U A365222 6051613,30377422,19549343,66761746,7926901,363311378,5861227,676386278,136503631,72622874,51204973,375025874
%N A365222 a(n) is the least semiprime such that a(n) - n and a(n) + n are the previous and the next semiprimes.
%e A365222 a(3) = 262 because 262 = 2 * 131 is a semiprime, the previous semiprime is 262 - 3 = 259 = 7 * 37, the next semiprime is 262 + 3 = 265 = 5 * 53, and no semiprime less than 262 works.
%p A365222 N:= 46: # for a(1) .. a(N)
%p A365222 V:= Vector(N):
%p A365222 b:= 6: d:= 2: count:= 0:
%p A365222 for i from 7 while count < N do
%p A365222   if numtheory:-bigomega(i) = 2 then
%p A365222     ib:= i-b;
%p A365222     if ib = d and ib <= N then
%p A365222       if V[d] = 0 then V[d]:= b; count:= count+1 fi
%p A365222     else d:= ib
%p A365222     fi;
%p A365222     b:= i;
%p A365222   fi;
%p A365222 od:
%p A365222 convert(V,list);
%Y A365222 Cf. A001358, A213025.
%K A365222 nonn
%O A365222 1,1
%A A365222 _Zak Seidov_ and _Robert Israel_, Aug 26 2023