(This article was originally published at R – Xi'an's Og, and syndicated at StatsBlogs.)
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
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.
Filed under: Books, Kids, R Tagged: Le Monde, mathematical puzzle, R
Please comment on the article here: R – Xi'an's Og
