A258187 Numbers m such that either m^k - 1 or m^k - 2 is prime for some positive k, but not both.
3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 29, 30, 31, 32, 33, 35, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 51, 53, 54, 55, 57, 59, 60, 61, 62, 63, 65, 67, 68, 69, 71, 72, 73, 74, 75, 77, 79, 80, 81, 83, 84, 85, 87, 89, 90, 91, 93, 95, 97, 98, 99, 101
Offset: 1
Examples
2 is not in this sequence because 2^2 - 1 = 3 and 2^2 - 2 = 2 are both prime. 3 is in this sequence because 3^1 - 1 = 2 (prime) and 3^1 - 2 = 1 (nonprime) or 3^2 - 1 = 5 (prime) and 3^2 - 2 = 4 (nonprime).
Programs
-
PARI
is(n)=n>2 && if(n%2,1,isprime(n-1)) \\ Charles R Greathouse IV, Jun 03 2015
Comments