2
$\begingroup$

Find the number of 5-digit positive integers n that have the following property: If we delete any digit in n, then we get a 4-digit number which is always divisible by 7. I did a little bit of modular arithmetic, but things got nasty. P.S:31,16 are wrong.(It's not that easy). I think the answer is 2

$\endgroup$
  • 3
    $\begingroup$ I would just program it. $\endgroup$ – Yuval Filmus Feb 9 '15 at 5:36
3
$\begingroup$

Suppose $abcde$ is such a number. In particular, $abcd$ and $abce$ are both divisible by $7$, so that $d\equiv e \pmod{7}$. Similar reasoning shows that in fact all of the digits are equivalent modulo $7$.

What should they be equivalent to? $1111 \pmod{7} = 5$, so $a,b,c,d,e$ must all be equivalent to $0$ modulo $7$. This gives us $2^5=32$ numbers, since each digit can be either $0$ or $7$. Actually only $31$ of these are positive.

$\endgroup$
  • $\begingroup$ Corroborated with a computer search. $\endgroup$ – Yuval Filmus Feb 9 '15 at 5:43
  • 2
    $\begingroup$ Also, a (conventionally) five-digit integer can't start with a zero, so it has to start with a seven, reducing it to only $2^4 = 16$ suitable integers. $\endgroup$ – kate Feb 9 '15 at 5:51
  • 2
    $\begingroup$ @kate ...and if you extend the requirement that the 4-digit, 3-digit, and 2-digit numbers must also not begin with $0$, no matter which digit you delete at each stage, you are left with only 2 options: $77777$ and $77770$. $\endgroup$ – Joffan Feb 9 '15 at 6:31
  • 2
    $\begingroup$ @Garvil There is more than one correct answer, since there is more than one interpretation of the question. In all cases, the solution is what I wrote. $\endgroup$ – Yuval Filmus Feb 9 '15 at 15:16
  • 1
    $\begingroup$ @Joffan - it only speaks of deleting one digit to get a 4-digit number. So it only requires that the first two digits are both 7, thus giving 8 options. $\endgroup$ – Glen O Feb 12 '15 at 6:55
1
$\begingroup$

Well, I solved my own question(that too with a bounty by me!). So here it is- Let the number be $abcde$. By the given property, $bcde$ and $acde$ are divisible by $7$. But then their difference $bcde−acde=1000(b−a)$ must be divisible by $7$, which means $b−a$ is divisible by $7$. In other words, $$a≡b(mod7)$$Considering other pairs of numbers, we also get $$b≡c(mod7)$$$$c≡d(mod7)$$$$ d≡e(mod7)$$ so $$a≡b≡c≡d≡e(mod7)$$ Then $abcd≡1111a≡0(mod7)$. Since $1111$ is relatively prime to $7$, $a≡0(mod7)$, so each digit must be $0$ or $7$. The digit $a$ must be $7$, and the digit $b$ must be $7$ (since $bcde$ must be a 4-digit number), but then $c, d, e$ can be set to $0$ or $7$ arbitrarily, which gives us $2^3=8$ possible numbers.

$\endgroup$
  • $\begingroup$ I will likely verify this soon. I like this question. $\endgroup$ – user142198 Feb 12 '15 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy