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 A276983 #33 Aug 22 2022 04:59:07 %S A276983 4,6,10,14,22,38,46,58,62,74,82,106,158,166,178,194,226,262,278,314, %T A276983 346,358,382,398,422,458,466,478,502,542,562,586,614,662,674,718,734, %U A276983 758,838,862,878,886,982,998,1018,1094,1154,1186,1202,1214,1238,1282,1306,1318,1322 %N A276983 Semiprimes n such that n-1 or n+1 is prime. %C A276983 Union of A077065 and A077068. %H A276983 Robert Israel, <a href="/A276983/b276983.txt">Table of n, a(n) for n = 1..10000</a> %F A276983 a(n) = 2*A120628(n). %e A276983 a(3) = 10 = 2*5 is a product of 2 primes and 10+1 = 11 is prime. %e A276983 a(4) = 14 = 2*7 is a product of 2 primes and 14-1 = 13 is prime. %p A276983 select(t -> isprime(t/2) and (isprime(t-1) or isprime(t+1)), [seq(i,i=2..10000,2)]); # _Robert Israel_, Sep 30 2016 %t A276983 func[n_] := PrimeOmega[n] == 2 && (PrimeQ[n + 1] || PrimeQ[n - 1]) %t A276983 Select[Range[1000], func[#] &] %o A276983 (PARI) isok(n) = (bigomega(n)==2) && (isprime(n-1) || isprime(n+1)); \\ _Michel Marcus_, Sep 24 2016 %o A276983 (PARI) lista(nn) = forprime(p=2, nn, if(isprime(2*p+1) || isprime(2*p-1), print1(2*p, ", "))); \\ _Altug Alkan_, Sep 30 2016 %o A276983 (Python) %o A276983 from sympy import isprime, primerange %o A276983 def aupto(N): return [t for t in (2*p for p in primerange(2, N//2+1)) if isprime(t-1) or isprime(t+1)] %o A276983 print(aupto(1322)) # _Michael S. Branicky_, Aug 21 2022 %Y A276983 Cf. A001358, A077065, A077068, A120628. %K A276983 nonn %O A276983 1,1 %A A276983 _Gary E. Davis_, Sep 24 2016