A259744 Smallest prime p such that, for every positive integer k <= n, the concatenation of p, prime(k)^2 and reverse(p) is prime.
11, 17, 1097, 7949, 780587, 123638027, 3259714649, 76526081651
Offset: 1
Examples
a(3)=1097 because 109747901 (1097&2^2&7901) and 109797901 (1097&3^2&7901) and 1097257901 (1097&5^2&7901) are prime numbers, and 1097 is the smallest prime for which this is the case.
Links
- Carlos Rivera Puzzles, Puzzle 788. P&p(i)^2&RP
Programs
-
Mathematica
f[n_, k_] := FromDigits[Join[ IntegerDigits[n], IntegerDigits[Prime[k]^2], Reverse[IntegerDigits[n]]]] a[n_] := Module[{p = 2, k = 1}, While[k <= n, If[PrimeQ[f[p, k]], k++, p = NextPrime[p]; k = 1]; ]; Return[p] ](* Kellen Myers, Aug 16 2015 , note this is very slow *)
Comments