Wednesday, September 23, 2026

2026/079) Find a 7-digit integer divisible by 128, whose decimal representation contains only the digits 2 and 3.

 

We have $128= 2^7$

For n digit number to have $2^n$ a factor we must have $n-1$ digit number after removing the left most digit must have $2^{n-1}$ as a factor

To illustrate we have 2 divides 2 and 4 divides 32. if unit digit is not divisible by 2 then 2 digit number is not divisible by 2^2 or 4

So we start with a number and add a digit to the left and repeat the steps. If n digit number is divisible by $2^{n+1}$ then we should append 2 to the left. and if it not divisible by $2^{n+1}$ then we should append 3.

This is so because we need to make the n+1 digit number divisible by $2^{n+1}$

We know $2^n$ divides $10^n$

So $2^{n+1}$ divides $2 * 10^n$

So if (n-1) digit number is  divisible by $2^n$ then we add $2 * 10^n$ to it and it shall be divisible by $2^n$

If  (n-1) digit number is  not divisible by $2^n$ but divisible of $2^{n-1}$ then we add $1 * 10^{n-1}$ which is n digit number to it and it shall be divisible by $2^n$.  As 1 is not in digit so we can add $3 * 10^(n-1)$ to it.

So if n digit number is divisible by $2^(n+1)$ then append 3 to the left else add 2 to the left. 

One digit number $2$

As 2 is not divisible by $2^2=4$ so append 3 to get 2 digit number $32$

As 32 is divisible by $2^3=8$ so append 2 to get 3 digit number $232$

As 232 is not divisible by $2^4=16$ so append 3 to get 4 digit number $3232$ 

As 3232 is divisible by $2^5=32$ so append 2 to get 5 digit number $23232$

As 23232 is divisible by $2^6=64$ so append 2 to get 6 digit number $223232$

As 223232 is divisible by $2^7=128$ so append 2 to get 7 digit number $2223232  

So ans is 7 digit number $2223232$

No comments: