perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/' #### for(1..100){push@_,$_ if (1 x $_) !~ /^1?$|^(11+?)\1+$/}