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.

This 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

[sourcecode language=”r” gutter=”false”]
pris=1e6
for (i in 1e4:1e5){
pres=i/sum((i %% 10^{5:1})) %/% 10^{4:0})
if (pres<pris){
pris=pres;sol=i}}
[/sourcecode]

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.

2 Responses to “Le Monde puzzle [#964]”

  1. 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)) .

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

Leave a Reply

Discover more from Xi'an's Og

Subscribe now to keep reading and get access to the full archive.

Continue reading