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.

A276983 Semiprimes n such that n-1 or n+1 is prime.

Original entry on oeis.org

4, 6, 10, 14, 22, 38, 46, 58, 62, 74, 82, 106, 158, 166, 178, 194, 226, 262, 278, 314, 346, 358, 382, 398, 422, 458, 466, 478, 502, 542, 562, 586, 614, 662, 674, 718, 734, 758, 838, 862, 878, 886, 982, 998, 1018, 1094, 1154, 1186, 1202, 1214, 1238, 1282, 1306, 1318, 1322
Offset: 1

Views

Author

Gary E. Davis, Sep 24 2016

Keywords

Comments

Union of A077065 and A077068.

Examples

			a(3) = 10 = 2*5 is a product of 2 primes and 10+1 = 11 is prime.
a(4) = 14 = 2*7 is a product of 2 primes and 14-1 = 13 is prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t/2) and (isprime(t-1) or isprime(t+1)), [seq(i,i=2..10000,2)]); # Robert Israel, Sep 30 2016
  • Mathematica
    func[n_] := PrimeOmega[n] == 2 && (PrimeQ[n + 1] || PrimeQ[n - 1])
    Select[Range[1000], func[#] &]
  • PARI
    isok(n) = (bigomega(n)==2) && (isprime(n-1) || isprime(n+1)); \\ Michel Marcus, Sep 24 2016
    
  • PARI
    lista(nn) = forprime(p=2, nn, if(isprime(2*p+1) || isprime(2*p-1), print1(2*p, ", "))); \\ Altug Alkan, Sep 30 2016
    
  • Python
    from sympy import isprime, primerange
    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)]
    print(aupto(1322)) # Michael S. Branicky, Aug 21 2022

Formula

a(n) = 2*A120628(n).