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.
%I A371651 #33 Apr 13 2024 17:11:50 %S A371651 5,23,173,2693,32587,495637,4447627,35303123,717591877,928090627, %T A371651 69692326373,745041171877,5012236328123,64215009765623, %U A371651 945336806640623,8885812685546873 %N A371651 a(n) is the first prime p such that p - 2 and p + 2 both have exactly n prime factors, counted with multiplicity. %C A371651 a(n) is the first prime p such that A001222(p - 2) = A001222(p + 2) = n. %C A371651 3*10^9 < a(13) <= 5012236328123. %C A371651 3*10^9 < a(14) <= 64215009765623. %F A371651 a(n) > 2*A154704(n) for n > 1. %e A371651 a(3) = 173 because 173 is prime, 173 - 2 = 171 = 3^2 * 19 and 173 + 2 = 175 = 5^2 * 7 are both products of 3 primes with multiplicity, and no smaller number works. %p A371651 V:= Vector(8): %p A371651 p:= 3: count:= 0: %p A371651 while count < 8 do %p A371651 p:= nextprime(p); %p A371651 i:= numtheory:-bigomega(p-2); %p A371651 if i <= 8 and V[i] = 0 and numtheory:-bigomega(p+2) = i %p A371651 then V[i]:= p; count:= count+1 %p A371651 fi %p A371651 od: %p A371651 convert(V,list); %o A371651 (Python) %o A371651 from sympy import primeomega, nextprime %o A371651 def A371651(n): %o A371651 p = 3 %o A371651 while True: %o A371651 if n == primeomega(p-2) == primeomega(p+2): %o A371651 return p %o A371651 p = nextprime(p) # _Chai Wah Wu_, Apr 02 2024 %o A371651 (PARI) %o A371651 generate(A, B, n) = A=max(A, 2^n); (f(m, p, j) = my(list=List()); if(j==1, forprime(q=max(p,ceil(A/m)), B\m, my(t=m*q); if(isprime(t-2) && bigomega(t-4) == n, listput(list, t-2))), forprime(q = p, sqrtnint(B\m, j), list=concat(list, f(m*q, q, j-1)))); list); vecsort(Vec(f(1, 3, n))); %o A371651 a(n) = my(x=2^n, y=2*x); while(1, my(v=generate(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ _Daniel Suteu_, Apr 13 2024 %Y A371651 Cf. A001222. Contained in A371622. %Y A371651 Cf. A115186, A154704. %K A371651 nonn,more %O A371651 1,1 %A A371651 _Robert Israel_, Apr 01 2024 %E A371651 a(11) from _Michael S. Branicky_, Apr 01 2024 %E A371651 a(12) from _Michael S. Branicky_, Apr 02 2024 %E A371651 a(13) from _Chai Wah Wu_, Apr 04 2024 %E A371651 a(14)-a(16) from _Daniel Suteu_, Apr 13 2024