Jump to content

Prime words: Difference between revisions

m
→‎{{header|Raku}}: add another variation
m (→‎{{header|Raku}}: update output for updated code)
m (→‎{{header|Raku}}: add another variation)
Line 262:
@words.grep({ .comb».ord.sum.is-prime }).&{display +$_, .head(20)};
 
say "\n\nIterpretingnInterpreting 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: ",
Line 291 ⟶ 294:
 
 
IterpretingInterpreting 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;
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.