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.

A174269 Numbers k such that exactly one of 2^k - 1 and 2^k + 1 is a prime.

This page as a plain text file.
%I A174269 #39 Feb 20 2023 07:52:52
%S A174269 0,1,3,4,5,7,8,13,16,17,19,31,61,89,107,127,521,607,1279,2203,2281,
%T A174269 3217,4253,4423,9689,9941,11213,19937,21701,23209,44497,86243,110503,
%U A174269 132049,216091,756839,859433,1257787,1398269,2976221,3021377,6972593,13466917
%N A174269 Numbers k such that exactly one of 2^k - 1 and 2^k + 1 is a prime.
%C A174269 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
%C A174269 Numbers k such that one of 2^k+1 or 2^k-1 is prime, but not both. - _R. J. Mathar_, Mar 29 2010
%C A174269 The sequence "Numbers k such that 2^k + (-1)^k is a prime" gives essentially the same sequence, except with the initial 1 replaced by 2. - _Thomas Ordowski_, Dec 26 2016
%C A174269 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
%C A174269 The union of 2 and this sequence is the values k for which either 2^k - 1 or 2^k + 1, or both, are prime. The reason why this only yields one additional term, 2, is because the number 3 always divides either 2^k - 1 or 2^k + 1 (also implicit in Ordowski comment). - _Jeppe Stig Nielsen_, Feb 19 2023
%H A174269 Jeppe Stig Nielsen, <a href="/A174269/b174269.txt">Table of n, a(n) for n = 1..52</a>
%F A174269 a(n) = A285929(n) for n > 2. - _Jeppe Stig Nielsen_, Feb 19 2023
%e A174269 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.
%t A174269 Select[Range[0, 5000], Xor[PrimeQ[2^# - 1], PrimeQ[2^# + 1]] &] (* _Michael De Vlieger_, Jan 03 2016 *)
%o A174269 (PARI) isok(k) = my(p = 2^k-1, q = p+2); bitxor(isprime(p), isprime(q)); \\ _Michel Marcus_, Jan 03 2016
%Y A174269 Cf. A000043, A092506, A019434, A285929.
%K A174269 nonn
%O A174269 1,3
%A A174269 _Juri-Stepan Gerasimov_, Mar 14 2010
%E A174269 a(10)-a(43) from _Charles R Greathouse IV_, Mar 20 2010