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.

A104279 Numbers n such that 2n+1 is prime and 2n-1 is not prime.

Original entry on oeis.org

1, 5, 8, 11, 14, 18, 20, 23, 26, 29, 33, 35, 39, 41, 44, 48, 50, 53, 56, 63, 65, 68, 74, 78, 81, 83, 86, 89, 95, 98, 105, 111, 113, 116, 119, 125, 128, 131, 134, 138, 140, 146, 153, 155, 158, 165, 168, 173, 176, 179, 183, 186, 189, 191, 194, 198, 200, 204, 209, 215
Offset: 1

Views

Author

Alexandre Wajnberg, Apr 17 2005

Keywords

Examples

			a(1)=1 because 3 is prime and 1 is not prime.
a(2)=5 because 11 is prime and 9 is not prime.
		

Crossrefs

Cf. A040040 and others.

Programs

  • Magma
    [n: n in [1..220]| not IsPrime(2*n-1) and IsPrime(2*n+1)] // Vincenzo Librandi, Jan 28 2011
    
  • Maple
    filter:= n -> isprime(2*n+1) and not isprime(2*n-1):
    select(filter, [$1..300]); # Robert Israel, Apr 27 2020
  • Mathematica
    Select[ Range[218], PrimeQ[2# + 1] && !PrimeQ[2# - 1] &] (* Robert G. Wilson v, Apr 18 2005 *)
  • PARI
    is(n)=isprime(2*n+1) && !isprime(2*n-1) \\ Charles R Greathouse IV, Jun 13 2017

Extensions

More terms from Robert G. Wilson v, Apr 18 2005