A Quora question asks "List all the three-digit numbers which have the
property that the sum of their digits is equal to 5"

I got the answer explicitly, by a straightforward brute force approach::

a#~5=+/"1]10#.^:_1 a=:100+i.900

104 113 122 131 140 203 212 221 230 302 311 320 401 410 500


How can this be written implicitly?


Skip


Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to