Prime words: Difference between revisions

Content added Content deleted
m (→‎{{header|Raku}}: update output for updated code)
m (→‎{{header|Raku}}: add another variation)
Line 262: Line 262:
@words.grep({ .comb».ord.sum.is-prime }).&{display +$_, .head(20)};
@words.grep({ .comb».ord.sum.is-prime }).&{display +$_, .head(20)};


say "\n\nIterpreting the words as if they were base 36 numbers:";
say "\n\nInterpreting the words as if they were base 36 numbers:";

say "\nNumber of words whose 'digits' are all prime in base 36: ",
@words.hyper.grep({ !.contains(/\W/) && all(.comb».parse-base(36)).is-prime }).&{display +$_, $_, ''};


say "\nNumber of words that are prime in base 36: ",
say "\nNumber of words that are prime in base 36: ",
Line 291: Line 294:




Iterpreting the words as if they were base 36 numbers:
Interpreting the words as if they were base 36 numbers:

Number of words whose 'digits' are all prime in base 36: 18;
2nd, 5th, 7th, b, d, h, j, n, nd, nh, nj, nv, t, tn, tnt, tv, v, vt


Number of words that are prime in base 36: 1106;
Number of words that are prime in base 36: 1106;