Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions
Content added Content deleted
(→{{header|J}}: discard uniques to avoid three copies of 111) |
m (→{{header|J}}: last edit comment should have said "discard duplicates...") |
||
Line 252: | Line 252: | ||
=={{header|J}}== |
=={{header|J}}== |
||
Generating the numbers as the cartesian product of the eligible digits (and sorting the result, for "prettiness"): |
Generating the numbers as the cartesian product of the eligible digits (and sorting the result, for "prettiness"): |
||
<lang J> ~./:~10 #. >,{~.(2 1#1;i.10){~(! A.&i. ])3 |
<lang J> ~./:~10 #. >,{~.(2 1#1;i.10){~(! A.&i. ])3 |
||
11 101 110 111 112 113 114 115 116 117 118 119 121 131 141 151 161 171 181 191 211 311 411 511 611 711 811 911</lang> |
11 101 110 111 112 113 114 115 116 117 118 119 121 131 141 151 161 171 181 191 211 311 411 511 611 711 811 911</lang> |