Jump to content

Smarandache prime-digital sequence: Difference between revisions

m
→‎{{header|zkl}}: add alternate solution
m (→‎{{header|zkl}}: add alternate solution)
Line 243:
if(p.split().filter( fcn(n){ 0==nps[n] }) ) return(Void.Skip);
p // 733 --> (7,3,3) --> () --> good, 29 --> (2,9) --> (9) --> bad
}.fp(BI(1)));</lang>
Or
<lang zkl>spds:=Walker.zero().tweak(fcn(ps){
var [const] nps="014689".inCommon;
p:=ps.nextPrime().toInt();
if(nps(p.toString())) return(Void.Skip);
p // 733 --> "" --> good, 29 --> "9" --> bad
}.fp(BI(1)));</lang>
<lang zkl>println("The first 25 terms of the Smarandache prime-digital sequence are:");
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.