RosettaCodeData/Task/Smarandache-prime-digital-sequence/Mathematica/smarandache-prime-digital-sequence.math
2023-07-01 13:44:08 -04:00

5 lines
195 B
Text

ClearAll[SmarandachePrimeQ]
SmarandachePrimeQ[n_Integer] := MatchQ[IntegerDigits[n], {(2 | 3 | 5 | 7) ..}] \[And] PrimeQ[n]
s = Select[Range[10^5], SmarandachePrimeQ];
Take[s, UpTo[25]]
s[[100]]