A071352 Numbers n such that the sum of two consecutive primes prime(n+1) + prime(n) is a prime power, say q^w. The w values are in A071087.
1, 2, 18, 564, 1462626667154509638735
Offset: 1
Examples
n=1: p(2)+p(1) = 3+2 = 5^1 n=2: p(3)+p(2) = 5+3 = 2^3 n=18: p(19)+p(18) = 61+67 = 2^7 n=564: p(565)+p(564) = 4099+4093 = 2^13
Programs
-
Mathematica
Do[s=Prime[n+1]+Prime[n]; If[Equal[Length[FactorInteger[s]], 1], Print[{n, Prime[n], s}]], {n, 1, 10000000}] p = q = 2; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Do[q = NextPrim[p]; If[ Length[ Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[p + q]]] == 1, Print[n]]; p = q, {n, 1, 10^7}] (* Robert G. Wilson v, Jan 24 2004 *)
Formula
Extensions
a(5) added by Max Alekseyev, Feb 10 2011