A267944 Primes that are a prime power minus two.
2, 3, 5, 7, 11, 17, 23, 29, 41, 47, 59, 71, 79, 101, 107, 137, 149, 167, 179, 191, 197, 227, 239, 241, 269, 281, 311, 347, 359, 419, 431, 461, 521, 569, 599, 617, 641, 659, 727, 809, 821, 827, 839, 857, 881
Offset: 1
Keywords
Examples
2 is in the sequence because 2 = 2^2 - 2. 3 is in the sequence because 3 = 5^1 - 2. 5 is in the sequence because 5 = 7^1 - 2. 7 is in the sequence because 7 = 3^2 - 2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Wikipedia, Generalized Bunyakovsky conjecture
Programs
-
Maple
select(t -> isprime(t) and nops(numtheory:-factorset(t+2))=1, [2, seq(i,i=3..1000, 2)]); # Robert Israel, Jan 22 2016
-
Mathematica
A267944Q = PrimeQ@# && Length@FactorInteger[# + 2] == 1 & (* JungHwan Min, Jan 24 2016 *) Select[Array[Prime, 100], Length@FactorInteger[# + 2] == 1 &] (* JungHwan Min, Jan 24 2016 *) Select[Prime[Range[300]],PrimePowerQ[#+2]&] (* Harvey P. Dale, Nov 28 2016 *)
-
PARI
lista(nn) = {forprime(p=2, nn, if (isprimepower(p+2), print1(p, ", ")););} \\ Michel Marcus, Jan 22 2016
-
Sage
[n - 2 for n in prime_powers(1, 1000) if is_prime(n - 2)]
Comments