continental divide
While the Riddler puzzle this week was anticlimactic, as it meant filling all digits in the above division towards a null remainder, it came as an interesting illustration of how different division is taught in the US versus France: when I saw the picture above, I had to go and check an American primary school on-line introduction to division, since the way I was taught in France is something like that
with the solution being that 12128316 = 124 x 97809… Solved by a dumb R exploration of all constraints:
for (y in 111:143) for (z4 in 8:9) for (oz in 0:999){ z=oz+7e3+z4*1e4 x=y*z digx=digits(x) digz=digits(z) if ((digz[2]==0)&(x>=1e7)&(x<1e8)){ r1=trunc(x/1e4)-digz[5]*y if ((digz[5]*y>=1e3)&(digz[4]*y<1e4) &(r1>9)&(r1<100)){ r2=10*r1+digx[4]-7*y if ((7*y>=1e2)&(7*y<1e3)&(r2>=1e2)&(r2<1e3)){ r3=10*r2+digx[3]-digz[3]*y if ((digz[3]*y>=1e2)&(digz[3]*y<1e3)&(r3>9)&(r3<1e2)){ r4=10*r3+digx[2] if (r4<y) solz=rbind(solz,c(y,z,x)) }}}}
Looking for a computer-free resolution, the constraints on z exhibited by the picture are that (a) the second digit is 0 and the fourth digit is 7. Moreover, the first and fifth digits are larger than 7 since y times these digits is a four-digit number. Better, since the second subtraction from a three-digit number by 7y returns a three-digit number and the third subtraction from a four-digit number by ny returns a two-digit number, n is larger than 7 but less than the first and fifth digits. Ergo, z is necessarily 97809! Furthermore, 8y<10³ and 9y≥10³, which means 111<y<125. Plus the constraint that 1000-8y≤99 implies y≥112. Nothing gained there! This leaves 12 values of y to study, unless there is another restriction I missed…
October 27, 2017 at 12:05 pm
Another approach is to start with multiplication. Then, we can filter the result to match 7 as the second digit:
library(dplyr)
divides <- as.numeric(seq(100, 999, by = 1))
divisor <- as.numeric(seq(17000, 97999, by = 1))
multi1 <- divides * divisor
result <- cbind.data.frame(divides, multi1)
colnames(result) <- c("Number1", "Number2")
result1 1e7)
write.csv(result1, file = “result1.csv”)
In Excel, I have copied result1.csv and then split the last column so that the first and second digits are in separate columns.
This approach brings 6582 answers to this continental divide.
May 24, 2017 at 6:53 pm
I’m missing something here. Why is the second digit 0? It’s not shown as such in the figure, but it must be obvious (except to me!)
May 24, 2017 at 6:54 pm
Sorry, I didn’t mean this as a reply to “continental divide” but as a question to Christian.
May 24, 2017 at 7:55 pm
I see it now. Doh!
May 24, 2017 at 9:00 pm
Good! It took me a while to spot that zero… If you get to The Riddler website, there is a complete video about the resolution, no computer involved!
May 19, 2017 at 4:11 am
[…] article was first published on R – Xi'an's Og, and kindly contributed to […]