Prime words: Difference between revisions

Content added Content deleted
(→‎{{header|Raku}}: Get all of the ridiculousness out there so we don't have to see any more of these tasks)
m (→‎{{header|Raku}}: more stupid variations)
Line 275: Line 275:
say "\nNumber of words whose base 36 digital sum is prime: ",
say "\nNumber of words whose base 36 digital sum is prime: ",
@words.grep({ !.contains(/\W/) && .comb».parse-base(36).sum.is-prime }).&{display +$_, .head(20)};
@words.grep({ !.contains(/\W/) && .comb».parse-base(36).sum.is-prime }).&{display +$_, .head(20)};

say "\nNumber of words that are prime in base 36, and whose digital sum is prime: ",
@words.grep({ !.contains(/\W/) && :36($_).is-prime && .comb».parse-base(36).sum.is-prime }).&{display +$_, .head(20)};


say "\nNumber of words that are prime in base 36, whose digits are all prime, and whose digital sum is prime: ",
say "\nNumber of words that are prime in base 36, whose digits are all prime, and whose digital sum is prime: ",
Line 292: Line 295:
say "\nNumber of words whose digital sum is prime using a custom base 26: ",
say "\nNumber of words whose digital sum is prime using a custom base 26: ",
@words.grep({ !.contains(/<-alpha>/) && .comb».&from-base(26).sum.is-prime }).&{display +$_, .head(20)};
@words.grep({ !.contains(/<-alpha>/) && .comb».&from-base(26).sum.is-prime }).&{display +$_, .head(20)};

say "\nNumber of words that are prime in a custom base 26 and whose digital sum is prime in that base: ",
@words.grep({ !.contains(/<-alpha>/) && .&from-base(26).is-prime && .comb».&from-base(26).sum.is-prime }).&{display +$_, .head(20)};


say "\nNumber of words that are prime in custom base 26, whose digits are all prime, and whose digital sum is prime: ",
say "\nNumber of words that are prime in custom base 26, whose digits are all prime, and whose digital sum is prime: ",
Line 316: Line 322:
Number of words whose base 36 digital sum is prime: 4740;
Number of words whose base 36 digital sum is prime: 4740;
First 20: 10th, 3rd, 7th, aba, abacus, abalone, abase, abater, abelian, abelson, aberrant, abeyant, ablaze, abort, aboveground, abraham, abrasion, abrasive, abreact, abridge
First 20: 10th, 3rd, 7th, aba, abacus, abalone, abase, abater, abelian, abelson, aberrant, abeyant, ablaze, abort, aboveground, abraham, abrasion, abrasive, abreact, abridge

Number of words that are prime in base 36, and whose digital sum is prime: 300;
First 20: 10th, 7th, abort, accident, acid, ad, adorn, adulthood, afterthought, albeit, alvin, armload, around, arragon, arraign, assassin, asteroid, astound, augean, avocation


Number of words that are prime in base 36, whose digits are all prime, and whose digital sum is prime: 8;
Number of words that are prime in base 36, whose digits are all prime, and whose digital sum is prime: 8;
Line 331: Line 340:
Number of words whose digital sum is prime using a custom base 26: 5473;
Number of words whose digital sum is prime using a custom base 26: 5473;
First 20: ababa, aback, abacus, abalone, abase, abater, abc, abdicate, abdomen, abe, abelian, abelson, aberrant, abeyant, ablaze, abolish, abominate, aborigine, aboveground, abraham
First 20: ababa, aback, abacus, abalone, abase, abater, abc, abdicate, abdomen, abe, abelian, abelson, aberrant, abeyant, ablaze, abolish, abominate, aborigine, aboveground, abraham

Number of words that are prime in a custom base 26 and whose digital sum is prime in that base: 292;
First 20: abolish, abreact, absurd, ac, ad, adjutant, adult, agricultural, ah, aid, al, allah, allied, altar, an, annal, ar, arclength, argonaut, asocial


Number of words that are prime in custom base 26, whose digits are all prime, and whose digital sum is prime: 9;
Number of words that are prime in custom base 26, whose digits are all prime, and whose digital sum is prime: 9;