Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions
Content added Content deleted
Line 120: | Line 120: | ||
[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] |
[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> |
</pre> |
||
=={{header|Nim}}== |
|||
<lang Nim>import sugar, strutils |
|||
let result = collect(newSeq): |
|||
for n in 1..<1000: |
|||
if count($n, '1') == 2: n |
|||
echo "Found ", result.len, " numbers:" |
|||
echo result.join(" ")</lang> |
|||
{{out}} |
|||
<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|Phix}}== |
=={{header|Phix}}== |