my solution f1=:*./@:* NB. all non-zero
f2=: 3=#@~. NB. no duplication g=: 10 10 10#: i.1000 h=: I.(f1 *. f2)"1 g $h 504 10 {. h 123 124 125 126 127 128 129 132 134 135 On Aug 12, 2017 5:17 PM, "Skip Cave" <s...@caveconsulting.com> wrote: > How can I use J to generate all the possible 3-digit integers that can be > constructed using the digits 1-9 (no zeros), with no repeated digits in > each integer? The sequence starts with 123 (smallest) and goes to 987 > (largest). Here's the first few integers in the sequence: > > 123 124 125 126 127 128 129 132 134 135 136 137 138 139 142 143 145 146 147 > 148 149 152 153 154 156 157 158 159 162...... > > Skip > > Skip Cave > Cave Consulting LLC > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm