A242377 Greatest n-digit prime in which every two-digit string is also a prime.
7, 97, 971, 9719, 97973, 979717, 9797371, 97973731, 979797979, 9797979713, 97979797171, 979797973117, 9797979797971, 97979797973173, 979797979797317, 9797979797979719, 97979797979797373, 979797979797971179, 9797979797979737971
Offset: 1
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..100
Programs
-
Mathematica
fQ[p_] := Block[{id = IntegerDigits@ p}, Union@ PrimeQ[ FromDigits@# & /@ Partition[id, 2, 1]] == {True}]; f[n_] := Block[{p = NextPrime[10^n*97/99, -1]}, While[ !fQ@ p, p = NextPrime[p, -1]]; p]; f[1] = 7; Array[f, 19]
Comments