Here's what I have done: since 5 digits are at least 1, that leaves the value 17-5 = 12 to be distributed in the rest of the digits so right now, the number is 11,111. the value 12 is distributed into the 5 digits, and using the stars and bars method, the answer should be 16C4 = 1820
What am I doing wrong (btw, the answer shows as 1645, but I don't know how)
0, and true as1, and therefore the expressionsum(n=10000,99999,d=digits(n);vecmin(d)>0&&vecsum(d)==17)gives you the result (indeed1645). Of course, this is not an answer. – Jeppe Stig Nielsen Dec 31 '23 at 12:08