Prime Substrings by leonid

#!ruby -p
$_=(1..~/$/).map{|a|(0..~/$/-a).map{|i|(2...d=$_[i,a].to_i).all?{|k|d%k>0}&&d>1?1:0}},$/

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page