这样的素数叫做左截断素数[1], 其中十进制中最大的是 357686312646216567629137, 十进制中一共有4256个这样的素数
LeftTruncatablePrimes [ 1 ] := Select [ Range [ 9 ], PrimeQ ] LeftTruncatablePrimes [ n_ ] := LeftTruncatablePrimes [ n ] = Block [ { list = Outer [ List , Range [ 1 , 9 ], LeftTruncatablePrimes [ n - 1 ]]}, Select [ #1 * 10 ^ ( n - 1 ) + #2 & @@@ Flatten [ list , 1 ], PrimeQ ] ]
同理可以定义右截断素数, 共79个, 最大的是 73939133
RightTruncatablePrimes [ 1 ] := Select [ Range [ 9 ], PrimeQ ] RightTruncatablePrimes [ n_ ] := RightTruncatablePrimes [ n ] = Block [ { list = Outer [ List , RightTruncatablePrimes [ n - 1 ], { 1 , 3 , 6 , 7 , 8 , 9 }]}, Select [ 10 #1 + #2 & @@@ Flatten [ list , 1 ], PrimeQ ] ]