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 A086005 #39 Feb 16 2025 08:32:50 %S A086005 34,86,94,122,142,202,214,218,302,394,446,634,698,842,922,1042,1138, %T A086005 1262,1346,1402,1642,1762,1838,1894,1942,1982,2102,2182,2218,2306, %U A086005 2362,2434,2462,2518,2642,2722,2734,3098,3386,3602,3694,3866,3902,3958,4286,4414 %N A086005 Semiprimes sandwiched between semiprimes. %C A086005 These are some of the balanced semiprimes (see A213025). - _Alonso del Arte_, Jun 04 2012 %H A086005 T. D. Noe, <a href="/A086005/b086005.txt">Table of n, a(n) for n=1..10000</a> %H A086005 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Semiprime.html">Semiprime</a> %F A086005 a(n) = 2*A086006(n). %F A086005 a(n) = A056809(n)+1. - _Zak Seidov_, Sep 30 2012 %e A086005 94 = 47*2: 94 - 1 = 3*31 and 94 + 1 = 5*19, therefore 94 is in the sequence. %t A086005 u[n_]:=Plus@@Last/@FactorInteger[n]==2;lst={};Do[If[u[n],sp=n;If[u[sp-1]&&u[sp+1],AppendTo[lst,sp]]],{n,8!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Nov 16 2009 *) %t A086005 (* First run program for A109611 to define semiPrimeQ *) Select[Range[4000], Union[{semiPrimeQ[# - 1], semiPrimeQ[#], semiPrimeQ[# + 1]}] == {True} &] (* _Alonso del Arte_, Jun 03 2012 *) %t A086005 Select[Partition[Range@ 4000, 3, 1], Union@ PrimeOmega@ # == {2} &][[All, 2]] (* _Michael De Vlieger_, Jun 14 2017 *) %o A086005 (Haskell) %o A086005 a086005 n = a086005_list !! (n-1) %o A086005 a086005_list = filter %o A086005 (\x -> a064911 (x - 1) == 1 && a064911 (x + 1) == 1) a100484_list %o A086005 -- _Reinhard Zumkeller_, Aug 08 2013, Jun 10 2012 %o A086005 (Python) %o A086005 from itertools import count, islice %o A086005 from sympy import factorint, isprime %o A086005 def agen(): # generator of terms %o A086005 nxt = 0 %o A086005 for k in count(2, 2): %o A086005 prv, nxt = nxt, sum(factorint(k+1).values()) %o A086005 if prv == nxt == 2 and isprime(k//2): yield k %o A086005 print(list(islice(agen(), 46))) # _Michael S. Branicky_, Nov 26 2022 %Y A086005 Cf. A001358, A056809, A064911, A100484, A123255. %K A086005 nonn %O A086005 1,1 %A A086005 _Reinhard Zumkeller_, Jul 07 2003