How many seven-digit numbers can be divisible by its unit digit? For example, 1,000,001, 1,000,002, 1,000,004, 1,000,005, and 1,000,008 are valid.
2026-04-15 06:22:54.1776234174
On
Number of 7-digit numbers divisible by its units digit problem
880 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
9
On
There are well known divisibility tests for each of the digits 1 through 9 (we obviously don't have to consider divisibility by 0). This should generate 9 different integer programming problems in 7 variables each, many of which I presume are easy to compute by hand, but some of which are probably a pain.
I would go implement a small program to check these 9 rules and then call it a day. If you for some reason don't want to use a computer for this (like if you are tying to make this a challenge problem for others) I would seriously take a good hard look at how difficult this is to finish by hand, particularly if you don't recall all the divisibility rules by heart.
There are $9,000,000$ $7$ digit numbers from $1,000,000$ to $9,000,000$ and for each of the $10$ digits there are $900,000$ number ending with that digit.
None of the numbers ending with $0$ are divisible by $0$. So those $900,000$ fail.
All the numbers ending with $1,5,$ and $2$ are divisible by $1,5,$ and $2$ so that is $2,700,000$ million that work.
For the other odd digits, $k$ and those digits are relatively prime to $10$ the roughly $\frac 1k$ of them in be divisible by $k$.
So for $3$, $300,000$ will be divisible by $3$.
For $7$, we expect there to be $\frac {900,000}7= 1,000,007\approx 128571.43$ of them divisible by $7$. So there will be either $128571$ or $128572$. The first number $1,000,007$ has has remainder $1$ when divide by $7$ so $1,000,017$ with have remainder $4$ when divided by $7$, and $1,000,027=7*142861$ will be divisible by $7$. Every seventh number up to $9,999,997$ will be divisible by $7$. So that is $128572$ more.
For $3$, $100,000$ will be divisible by $9$.
Because $\gcd(10,2)=2$ all then numbers ending with an even number, $k = 2m$ will be even and $\frac 1m$ of them will be divisible by $m$.
So for those ending with $4,6,8$ then $450,000$ ad $300,000$ and $225,000$ will be divisible.
So total is $3*900,000 + 300,000 + 128572 + 100,000 + 450,000 + 300,000 + 225,000 = 4203572$