A006549 Numbers k such that k and k+1 are prime powers.
1, 2, 3, 4, 7, 8, 16, 31, 127, 256, 8191, 65536, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
Offset: 1
References
- R. K. Guy, Unsolved Problems in Number Theory, D9.
- P. Ribenboim, 13 Lect. on Fermat's Last Theorem, p. 236.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- David W. Wilson and Eric Rains (rains(AT)caltech.edu) found a simple proof that in this case of Catalan's conjecture either n or n+1 must be a power of 2 and the other number must be a prime, except for n=8. Using this the sequence is easy to extend.
Links
- Daniel Forgues, Table of n, a(n) for n = 1..25
- Peter Cameron, Graphs on groups, 9, Peter Cameron's blog.
- Wacław Sierpiński, Sur une question concernant le nombre de diviseurs premiers d'un nombre naturel, Colloquium Mathematicum 6 (1958), 209-210.
- Eric Weisstein's World of Mathematics, Catalan's Conjecture.
- Eric Weisstein's World of Mathematics, Clique Number.
- Eric Weisstein's World of Mathematics, Fermat Prime.
- Eric Weisstein's World of Mathematics, Mersenne Prime.
Crossrefs
Cf. A019434 Fermat primes: primes of form 2^(2^n) + 1, n >= 0.
Cf. A000668 Mersenne primes (of form 2^p - 1 where p is a prime).
Cf. A120431 Numbers n such that n and n+2 are prime powers.
Cf. A164571 Numbers n such that n and n+3 are prime powers.
Cf. A164572 Numbers n such that n and n+4 are prime powers.
Cf. A164573 Numbers n such that n and n+5 are prime powers.
Cf. A164574 Numbers n such that n and n+6 are prime powers.
Programs
-
Haskell
a006549 n = a006549_list !! (n-1) a006549_list = [1,2,3,4,7,8] ++ f (drop 4 a000040_list) where f (p:ps) | a010055 (p - 1) == 1 = (p - 1) : f ps | a010055 (p + 1) == 1 = p : f ps | otherwise = f ps -- Reinhard Zumkeller, Jan 03 2013
-
Mathematica
Do[ a = Length[ FactorInteger[ 2^n - 1 ] ]; b = Length[ FactorInteger[ 2^n ] ]; c = Length[ FactorInteger[ 2^n + 1 ] ]; If[ a == b, Print[ 2^n - 1 ] ]; If[ b == c, Print[ 2^n ] ], {n, 0, 127} ] Join[{1},SequencePosition[Boole[PrimePowerQ[Range[600000]]],{1,1}][[All,1]]] (* Requires Mathematica version 10 or later *) (* Generates the first 14 terms of the sequence. Increase Range constant to generate more. *) (* Harvey P. Dale, Apr 12 2020 *)
-
PARI
is(n)=if(n<5,return(n>0)); isprimepower(n) && isprimepower(n+1) \\ Charles R Greathouse IV, Apr 24 2015
Extensions
More terms from David W. Wilson
Additional comments from Daniel Forgues, Aug 17 2009
Comments