The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A174269 Numbers n such that exactly one of 2^n - 1 and 2^n + 1 is a prime. 3
 0, 1, 3, 4, 5, 7, 8, 13, 16, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS Apart from the first term, all terms are primes (Mersenne exponents) or powers of two (Fermat exponents). The sequence consists of all members of A000043 and A092506, apart from 2. - Charles R Greathouse IV, Mar 20 2010 Numbers n such that one of 2^n+1 or 2^n-1 is prime, but not both. - R. J. Mathar, Mar 29 2010 The sequence "Numbers n such that 2^n + (-1)^n is a prime" gives essentially the same sequence, except with the initial 1 replaced by 2. - Thomas Ordowski, Dec 26 2016 The union of 2 and this sequence gives the values k for which 2^k or 2^k - 1 are the numbers in A006549. - Gionata Neri, Dec 19 2015 LINKS EXAMPLE 0 is in the sequence because 2^0 - 1 = 0 is nonprime and 2^0 + 1 = 2 is prime; 2 is not in the sequence because 2^2 - 1 = 3 and 2^2 + 1 = 5 are both prime. MATHEMATICA Select[Range[0, 5000], Xor[PrimeQ[2^# - 1], PrimeQ[2^# + 1]] &] (* Michael De Vlieger, Jan 03 2016 *) PROG (PARI) isok(n) = my(p = 2^n-1, q = p+2); bitxor(isprime(p), isprime(q)); \\ Michel Marcus, Jan 03 2016 CROSSREFS Cf. A000043, A092506, A019434. Sequence in context: A266796 A318603 A154571 * A112882 A180152 A162610 Adjacent sequences:  A174266 A174267 A174268 * A174270 A174271 A174272 KEYWORD nonn AUTHOR Juri-Stepan Gerasimov, Mar 14 2010 EXTENSIONS a(10)-a(43) from Charles R Greathouse IV, Mar 20 2010 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 31 00:16 EDT 2020. Contains 334747 sequences. (Running on oeis4.)