login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A264747
Prime powers n such that either n - 1 or n + 1 is a prime power, but not both.
1
1, 5, 7, 9, 16, 17, 31, 32, 127, 128, 256, 257, 8191, 8192, 65536, 65537, 131071, 131072, 524287, 524288, 2147483647, 2147483648, 2305843009213693951, 2305843009213693952, 618970019642690137449562111
OFFSET
1,2
COMMENTS
From Robert Israel, Nov 25 2015: (Start)
By Mihailescu's theorem, the only case where n-1 and n are both in A025475 is n=9. Thus for n > 9 the sequence consists of the following:
n = 2^p - 1 and 2^p where 2^p-1 is a Mersenne prime (A000668);
n = 2^(2^m) and 2^(2^m)+1 where 2^(2^m)+1 is a Fermat prime (A019434).
(End)
LINKS
EXAMPLE
7 is in this sequence because 7 and 7 + 1 = 8 are both prime power, but 7 - 1 = 6 is not a prime power.
MAPLE
fermats:= {seq(2^(2^m)+1, m=1..4)}:
mersennes:= {seq(numtheory:-mersenne([i]), i=2..14)}:
R:= fermats union map(`-`, fermats, 1) union mersennes union map(`+`, mersennes, 1):
sort(convert(R union {1, 9} minus {2, 3, 4, 8}, list)); # Robert Israel, Nov 25 2015
PROG
(PARI) is(k) = isprimepower(k) || k==1;
for(k=1, 1e6, if(is(k) && is(k-1) + is(k+1) == 1, print1(k, ", "))) \\ Altug Alkan, Nov 23 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved