Jump to content

Wasteful, equidigital and frugal numbers: Difference between revisions

m
→‎{{header|Perl}}: oops, didn't read directions...
m (→‎{{header|Raku}}: white space tweaks)
m (→‎{{header|Perl}}: oops, didn't read directions...)
Line 166:
elsif ( $l < $s) { push @W, $n }
else { push @F, $n }
} until 100010000 < min scalar @F, scalar @E, scalar @W;
 
say "In base $base:";
Line 172:
say "\n$type numbers:";
say table 10, @$values[0..49];
say "110,000th: $$values[9999999]";
$totals .= sprintf "%11s: %d\n", $type, scalar grep { $_ < 100001_000_000 } @$values
}
say "\nOf the positive integers up to tenone thousandmillion:\n$totals";
}</lang>
{{out}}
Line 187:
74 75 76 77 78 80 82 84 85 86
 
110,000th: 158614346
 
Equidigital numbers:
Line 196:
105 106 107 109 111 112 113 115 118 119
 
110,000th: 276533769
 
Frugal numbers:
Line 205:
4913 5041 5103 5329 6241 6250 6561 6859 6889 7203
 
110,000th: 1608011953125
 
Of the positive integers up to tenone thousandmillion:
Wasteful: 7709831231
Equidigital: 2236165645
Frugal: 543123
 
In base 11:
Line 221:
72 74 75 76 77 78 80 82 84 85
 
110,000th: 136412890
 
Equidigital numbers:
Line 230:
109 113 121 122 123 127 129 131 133 134
 
110,000th: 282333203
 
Frugal numbers:
Line 239:
5120 5329 6241 6250 6561 6859 6889 7168 7203 7921
 
110,000th: 2227842659171
 
Of the positive integers up to tenone thousandmillion:
Wasteful: 7478795861
Equidigital: 2468200710
Frugal: 533428</pre>
 
=={{header|Phix}}==
2,392

edits

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