Eban numbers: Difference between revisions

→‎{{header|Perl 6}}: modify to accept multi-letter 'bans', note OEIS sequences covered
m (→‎{{header|Perl 6}}: Better output formatting, trap some edge case errors.)
(→‎{{header|Perl 6}}: modify to accept multi-letter 'bans', note OEIS sequences covered)
Line 38:
Modular approach, very little is hard coded. Change the order of magnitude limits to adjust the search/display ranges. Change the letter given to the nban sub to change which letter to disallow.
 
Demonstrate for e-ban and t-ban. n-banWill andhandle imulti-bancharacter are'bans' interestingas toowell.
 
Directly find :
:* [[oeis:A006933|OEIS Numbers without e]]: Eban
:* [[oeis:A089589|OEIS Numbers without i]]: Iban
:* [[oeis:A089590|OEIS Numbers without u]]: Uban
:* [[oeis:A008521|OEIS Numbers without o]]: Oban
:* [[oeis:A008523|OEIS Numbers without t]]: Tban
:* [[oeis:A072954|OEIS Numbers without a, i, l, t]]: TALIban
 
<lang perl6>use Lingua::EN::Numbers::Cardinal;
 
sub nban ($seq, $n = 'e') { ($seq).map: { next if .&cardinal.contains(any($n.comb)); $_ } }
 
sub comma { $^i.flip.comb(3).join(',').flip }
10,339

edits