A091625 Number of consecutive primes less than 10^n such that their sum is a perfect power (A091624).
1, 5, 8, 17, 34, 87, 203, 510, 1331
Offset: 1
Keywords
Programs
-
Mathematica
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrimeExponents[n_] := Flatten[ Table[ #[[2]], {1}] & /@ FactorInteger[n]]; c = 0; p = q = 2; Do[ While[p < 10^n, q = NextPrim[p]; If[ Apply[ GCD, PrimeExponents[p + q]] > 1, c++ ]; p = q]; Print[c], {n, 1, 8}]