Anonymous user
Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions
Positive decimal integers with the digit 1 occurring exactly twice (view source)
Revision as of 01:58, 12 July 2021
, 2 years ago→{{header|Phix}}
(Add Factor) |
|||
Line 223:
<pre>Found 27 numbers:
11 101 110 112 113 114 115 116 117 118 119 121 131 141 151 161 171 181 191 211 311 411 511 611 711 811 911</pre>
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
use strict; # https://rosettacode.org/wiki/Numbers_n_in_which_number_1_occur_twice
use warnings;
my @twoones = grep tr/1// =~ 2, 1 .. 1000;
print "@twoones\n" =~ s/.{60}\K /\n/gr;</lang>
{{out}}
<pre>
11 101 110 112 113 114 115 116 117 118 119 121 131 141 151 161
171 181 191 211 311 411 511 611 711 811 911
</pre>
=={{header|Phix}}==
|