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 A124936 #28 Nov 26 2022 12:09:59 %S A124936 5,34,50,56,86,92,94,120,122,142,144,160,184,186,202,204,214,216,218, %T A124936 220,236,248,266,288,290,300,302,304,320,322,328,340,392,394,412,414, %U A124936 416,446,452,470,472,516,518,528,534,536,544,552,580,582,590,634,668 %N A124936 Numbers k such that k - 1 and k + 1 are semiprimes. %C A124936 All but the first term are even. %H A124936 Zak Seidov, <a href="/A124936/b124936.txt">Table of n, a(n) for n = 1..1000</a> %F A124936 a(n) = A092207(n) + 1; at n>=2, a(n) = 2*A082130(n-1). %t A124936 lst={};Do[If[Plus@@Last/@FactorInteger[n-1]==2&&Plus@@Last/@FactorInteger[n+1]==2,AppendTo[lst,n]],{n,7!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Feb 01 2009 *) %t A124936 Select[Range[2, 700], PrimeOmega[# + 1] == PrimeOmega[# - 1] == 2 &] (* _Vincenzo Librandi_, Mar 30 2015 *) %o A124936 (Magma) IsSemiprime:=func< n | &+[k[2]: k in Factorization(n)] eq 2 >; [ n: n in [1..700] | IsSemiprime(n+1) and IsSemiprime(n-1)]; // _Vincenzo Librandi_, Mar 30 2015 %o A124936 (PARI) list(lim)=if(lim<5,return([])); my(v=List([5]),x=1,y=1); forfactored(z=7,lim\1+1, if(vecsum(z[2][,2])==2 && vecsum(x[2][,2])==2, listput(v,z[1]-1)); x=y; y=z); Vec(v) \\ _Charles R Greathouse IV_, May 22 2018 %o A124936 (Python) %o A124936 from sympy import factorint %o A124936 from itertools import count, islice %o A124936 def agen(): # generator of terms %o A124936 yield 5 %o A124936 nxt = 0 %o A124936 for k in count(6, 2): %o A124936 prv, nxt = nxt, sum(factorint(k+1).values()) %o A124936 if prv == nxt == 2: yield k %o A124936 print(list(islice(agen(), 53))) # _Michael S. Branicky_, Nov 26 2022 %Y A124936 Cf. A092207 (k and k+2 are semiprimes), A086005 (k-1, k, k+1 are semiprimes), A086006 (primes p such that 2*p-1 and 2*p+1 are semiprimes), A082130 (2*k-1 and 2*k+1 are semiprimes). %K A124936 nonn %O A124936 1,1 %A A124936 _Zak Seidov_, Nov 13 2006