## Le Monde puzzle [#964]

**A** not so enticing Le Monde mathematical puzzle:

Find the minimal value of a five digit number divided by the sum of its digits.

**T**his can formalised as finding the minimum of N/(a+b+c+d+e) when N writes abcde. And solved by brute force. Using a rough approach to finding the digits of a five-digit number, the question can be easily solved as

pris=1e6 for (i in 1e4:1e5){ pres=i/sum((i %% 10^{5:1})) %/% 10^{4:0}) if (pres<pris){ pris=pres;sol=i}}

which returns N=10999 as its solution. (The solution for six digits is 10999.) The mathematical solution as provided in the newspaper certainly sounded more exciting.

June 2, 2016 at 7:11 pm

I was thinking it would have been more fun to write a set of parametric equations and let a back-solver have at it. Sadly, it appears there’s only a couple equations so the iteration might take longer than brute force. Might be fun to set this up while allowing a,b,c,d,e to be rationals in [0,9] and see what the solution is. Here I’d explicity define N as sum(c(a,b,c,d,e)*10^(0:4)) .

June 2, 2016 at 10:13 am

[…] article was first published on R – Xi'an's Og, and kindly contributed to […]