Pretty much the same as others, my tacit verb is f=: 100&+@I.@(5 = +/"1)@(10&#.^:_1) f 100+ i.900 104 113 122 131.... -------------------------------------------- On Wed, 1/16/19, 'Skip Cave' via Programming <[email protected]> wrote:
Subject: [Jprogramming] Implicit Coding To: "[email protected]" <[email protected]> Date: Wednesday, January 16, 2019, 4:12 PM 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
