2

How many $6$ digit numbers are divisible by $7$ ?

How do I calculate it ?

I know the obvious solution using arithmetic progression .I am looking for how to solve this linear modular equation:-

$1000000a+100000b+10000c+1000d+100e+10f+g= 0$($mod 7$) , where $a,b,c,d,e,f$ and $g$ are single digit numbers.

  • What is the least six digit number divisible by $7$? If you don't know the divisibility test, you can just try them. You won't have to try more than $7$. What is the greatest? How many are in between? What have you tried? – Ross Millikan Oct 04 '19 at 20:44
  • 1
    Try something simpler for the start... for example, how many $2$-digit numbers are divisible by $7$? –  Oct 04 '19 at 20:44
  • @RossMillikan I know the obvious solution . I am looking for how to solve this linear modular equation:- 1000000a+100000b+10000c+1000d+100e+10f+g= 0(mod 7) – Ananya Agarwal Oct 04 '19 at 20:48
  • Are $a,b,c,d,e,f,g \ge 0$ ? Also I think after you edited it it is a 7 digit number right? – Fareed Abi Farraj Oct 04 '19 at 20:53
  • You should ask what you are interested in. In your new version, you can reduce all the constants $\bmod 7$, then use the fact that all numbers other than $0$ are invertible $\bmod 7$ – Ross Millikan Oct 04 '19 at 20:53
  • a,b,c,d,e,f,g all are single digit numbers. I want to know the number of possible solutions. How do we do this ? @FareedAF – Ananya Agarwal Oct 04 '19 at 20:55

3 Answers3

4

In every 7 consecutive numbers there is one that is divisible by $7$, now do you know how many 6-digit numbers there are in the first place ?

The largest 5-digit number is $99,999$ and the smallest 7-digit number is $1,000,000$

Can you finish it from here?

After the edit, your equality can be reduced to $100,00b+10,000c+1,000d+100e+10f+g \equiv 5b + 4c +6d+2e+ 3f+g \equiv 0$ (mod $7$)

(Because you want a 6-digit number which means there must be no $1000000a$)

And each of these, for example $5b$ can be equivalent to any number $0,1,2,3,4,5,6$ (mod $7$)

So what your searching for is actually the number of ways in which you can add 6 numbers to form a multiple of $7$, where each number is between $0$ and $6$, i.e. the number of ways such that $a_1+a_2+a_3+a_4+a_5+a_6 \equiv 0$ (mod $7$) where $0\le a_i \le 6$ $\forall i$.

For example, some of the ways are $1+1+1+1+1+2$, $1+1+1+1+2+1$, $2+2+4+3+3+0$, ...

Each $a_i$ represents one of the above $5b$, $4c$, $6d$, ... that is why the order is important in the examples.

So after finding the number of ways, for example lets take $1+1+1+1+1+2$, i.e. we need to have $5b\equiv 1$, $4c\equiv 1$, $6d\equiv 1$ .... (mod $7$). So $b=3$, but we have $c=2$ or $c=9$, and $d=6$, ...

I mean in each way you have counted above (such as $1+1+1+1+1+2$) you have to count more "subways" that will give you the same example (because $c=2$ and $c=9$ give you the same example).

But anyway, this takes a lot of time, so I don't actually think that this is what you're searching for, and I couldn't have any other "arithmatical" solution in mind.

2

The first divisible number is $100002$, the last divisible number is $999999$. You can count the numbers which are divisible by $7$ with using this formula:

$$\frac{\textrm{last number} - \textrm{first number}}{\textrm{space between numbers}} + 1$$

In this case, that would be: $$\frac{999999 - 100002}{7} + 1 = 128572.$$

Mr. Brooks
  • 1,098
  • Can you look and give your ideas on a similar question:-https://math.stackexchange.com/questions/3381268/how-many-four-digit-numbers-and-its-reverse-are-divisible-by-7 – Firex Firexo Oct 05 '19 at 09:22
2

In my opinion, you're making things more complicated than necessary.

Since $10^6$ divided by 7 leaves a remainder of 1, this means 999999 is the largest 6-digit number divisible by 7. And 999999 divided by 7 is 142857. So maybe the answer is 142857.

However, that counts 5-, 4-, 3- and 2-digit numbers that are divisible by 7, and 7 itself. Since $10^5$ divided by 7 leaves a remainder of 5, this means 99995 is the largest 5-digit number divisible by 7. And 99995 divided by 7 that's 14285.

The answer should now be obvious.

Robert Soupe
  • 14,663