Eban numbers: Difference between revisions

→‎{{header|Perl 6}}: Add commas, correct order of magnitude, various tweaks
m (→‎{{header|Perl 6}}: update description to match)
(→‎{{header|Perl 6}}: Add commas, correct order of magnitude, various tweaks)
Line 134:
 
Directly find :
:* [[oeis:A006933|OEIS:A006933 Numbers without e]]: Eban
:* [[oeis:A089589|OEIS:A089589 Numbers without i]]: Iban
:* [[oeis:A089590|OEIS:A089590 Numbers without u]]: Uban
:* [[oeis:A008521|OEIS:A008521 Numbers without o]]: Oban
:* [[oeis:A008523|OEIS:A008523 Numbers without t]]: Tban
:* [[oeis:A072958|OEIS:A072958 Numbers without a, c, i, l]]: CALIban
:* [[oeis:A072954|OEIS:A072954 Numbers without a, i, l, t]]: TALIban
:* [[oeis:A072957|OEIS:A072957 Numbers without r, u]]: URban
:* [[oeis:A072956|OEIS:A072956 Numbers without r, t, u]]: TURban
:* [[oeis:A072955|OEIS:A072955 Numbers without b, r, s, u]]: SUBURban
:* ''and so on...''
 
Line 166:
 
for 'e', 't', 'subur' -> $n {
 
my $upto = 10; # 1e10
my @bans = filter($n, $upto);
 
# DISPLAY
my @k = @bans.grep: * <= 1001000;
my @j = @bans.grep: 1000 <= * <= 4000;
put "\n============= {$n}-ban: =============\n" ~
"{$n}-ban numbers up to 1001000: {+@k}\n {@k».&comma.gist}\n\n" ~
"{$n}-ban numbers between 1,000 & 4,000: {+@j}\n{@j».&comma.gist}\n";
 
for (1 .. $upto).map: { 10**$_ } -> $e {
my $f = @bans.first( * > $e, :k );
printf "Up to %14s: %ds\n", comma($e), comma($f ?? +@bans[^$f] !! +@bans);
}
}</lang>
{{out}}
<pre>============= e-ban: =============
e-ban numbers up to 1001000: 19
[2 4 6 30 32 34 36 40 42 44 46 50 52 54 56 60 62 64 66]
 
e-ban numbers between 1,000 & 4,000: 21
[2,000 2,002 2,004 2,006 2,030 2,032 2,034 2,036 2,040 2,042 2,044 2,046 2,050 2,052 2,054 2,056 2,060 2,062 2,064 2,066 4,000]
[2000 2002 2004 2006 2030 2032 2034 2036 2040 2042 2044 2046 2050 2052 2054 2056 2060 2062 2064 2066 4000]
 
Up to 10: 3
Line 196 ⟶ 195:
Up to 100,000: 399
Up to 1,000,000: 399
Up to 10,000,000: 15991,599
Up to 100,000,000: 79997,999
Up to 1,000,000,000: 79997,999
Up to 10,000,000,000: 3199931,999
 
============= t-ban: =============
t-ban numbers up to 1001000: 956
[0 1 4 5 6 7 9 11 100 101 104 105 106 107 109 111 400 401 404 405 406 407 409 411 500 501 504 505 506 507 509 511 600 601 604 605 606 607 609 611 700 701 704 705 706 707 709 711 900 901 904 905 906 907 909 911]
0 1 4 5 6 7 9 11 100
 
t-ban numbers between 1,000 & 4,000: 0
Line 216 ⟶ 215:
Up to 10,000,000: 392
Up to 100,000,000: 393
Up to 1,000,000,000: 27452,745
Up to 10,000,000,000: 1920819,208
 
============= subur-ban: =============
subur-ban numbers up to 1001000: 35
[1 2 5 8 9 10 11 12 15 18 19 20 21 22 25 28 29 50 51 52 55 58 59 80 81 82 85 88 89 90 91 92 95 98 99]
 
subur-ban numbers between 1,000 & 4,000: 0
Line 233 ⟶ 232:
Up to 1,000,000: 36
Up to 10,000,000: 216
Up to 100,000,000: 12951,295
Up to 1,000,000,000: 12951,295
Up to 10,000,000,000: 12951,295</pre>
 
=={{header|REXX}}==
10,333

edits