Another (possibly lighter on memory) approach:

~. ; (#:i.2^4) <@(10 #. i.@!@# A. ])@# 0 1 2 6

Cheers,
Louis

> On 21 Oct 2019, at 01:09, Skip Cave <[email protected]> wrote:
> 
> Is there a less-verbose way to list all the integers (one-digit, two-digit,
> three-digit, four-digit) can be formed by using the characters 0, 1, 2, and
> 6 once? I used multiple takes:
> 
> *#b=.~.>10#.ea({1{."1 a),({2{."1 a),({3{."1 a),{a=.(perm 4){0 1 2 6*
> 
> *49*
> 
> *b*
> 
> *0 1 2 6 10 12 16 20 21 26 60 61 62 102 106 120 126 160 162 201 206 210 216
> 260 261 601 602 610 612 620 621 1026 1062 1206 1260 1602 1620 2016 2061
> 2106 2160 2601 2610 6012 6021 6102 6120 6201 6210*
> 
> 
> 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

Reply via email to