Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. Another of those “drop-a-digit” Le Monde mathematical puzzle:

Find all integers n with 3 or 4 digits an single interior zero digit, such that removing that zero digit produces a divider of x.

As in puzzle #904, I made use of the digin R function:

```digin=function(n){
as.numeric(strsplit(as.character(n),"")[])}
```

and simply checked all integers up to 10⁶:

```plura=divid=NULL
for (i in 101:10^6){
dive=rev(digin(i))
if ((min(dive,rev(dive))>0)&
(sum((dive[-c(1,length(dive))]==0))==1)){
dive=dive[dive>0]
dive=sum(dive*10^(0:(length(dive)-1)))
if (i==((i%/%dive)*dive)){
plura=c(plura,i)
divid=c(divid,dive)}}}
```

```> plura
1] 105 108 405 2025 6075 10125 30375 50625 70875
> plura/divid
 7 6 9 9 9 9 9 9 9
```

leading to the conclusion there is no solution beyond 70875. (Allowing for more than a single zero within the inner digits sees many more solutions.)

Filed under: Books, Kids, R Tagged: integers, Le Monde, mathematical puzzle  