0

How many 6-digit numbers of the form $xyzzyx$ (where $y$ is a prime number) are possible which are divisible by 7?


My try: Since we were checking for a multiple of 7, I tried using the 7 divisibility rule and was left out with the following: $100000x+10000y+1000z+100z+10y-2x = a~multiple~of~7~or~0$

I really don't have any clue how to proceed further.

2 Answers2

3

Your number is

$$100000x + 10000y+1000z +100z+10y+z$$

$$ = 100001x + 10010y + 1100z$$

$$\equiv 6x+0y+z \equiv -x+z \pmod{7}.$$

I'm assuming $x$ is not $0$.

So it doesn't matter what $y$ is. Since it has to be prime, it's one of $2, 3, 5,$ or $7.$ So there are $4$ choices for $y$.

If $x=z$ there are $9$ possibilities, and then $4$ possibilities for $y$, giving us $36$ numbers.

If $x\neq z$ they have to differ by exactly $7$, so we have these possibilities for $(x,z) = (1,8), (2,9), (9,2), (8,1), (7,0)$ so that's $5\times 4 = 20$ more numbers. So the total is $56.$

B. Goddard
  • 33,728
1

This is much simpler than it seems. The divisibility rule for $7$ for $n$-digit number says that when the number is split into blocks of $3$ and an alternating sum formed from right to left, if the result is divisible by $7$ then so is the original number. For this problem, that means that $zyx-xyz$ must be divisible by $7$. $zyx = 100z+10y+x$ and $xyz=100x+10y+z$, so $zyx-xyz = 100z+10y+x-100x-10y-z=99z-99x=99(z-x)$.

$99$ is congruent to $1$ modulo $7$, so the only way $99(z-x)$ will be divisible by $7$ is if $z-x\equiv0\mod(7)$, keeping in mind that $z$ and $x$ are single digit numbers themselves. Obviously, the first set of solutions have $z=x$, and there are $9$ options: $z=x=1, z=x=2, z=x=3$, and so on. In addition, we have $z=9, x=2$ and $z=8, x=1$ and due to the symmetry of the congruence, $z=2, x=9$ and $z=1, x=8$ as well, for a running total of $9+4=13$. Finally, we have $z=0, x=7$ for a total of $14$.

Now to wrap it up: note that the only digit to be determined is $y$, and that it must be a single-digit prime number. There are only $4$ of these: $2,3,5,7$. Any of these can be substituted for $y$ in any of our $14$ possibilities, giving $4\cdot14 = 56$ $6$-digit numbers fulfilling the required format and being divisible by $7$. QED.

  • Very nicely done. My only reservation is that it also does OP's homework very nicely with essentially no input from them. What will they have learned? – David K Nov 21 '23 at 21:15
  • 3
    Well I mean, they did post their try, which is all we require of them, yeah? To say "I can see you've tried and I know you don't know what you're doing, but it's not detailed enough, so go figure something else out and come back" seems to me a bit unreasonable. As for "what will they have learned?", that depends on them doesn't it? I thought I laid the solution out pretty clearly, so if they follow and abstract it, they'll have learned plenty. I don't concern myself with that question — after all, we can give them as much water as we want, but that doesn't mean they'll always drink, does it? – H. sapiens rex Nov 21 '23 at 21:42
  • 1
    They said they tried the divisibility by 7 rule but then they merely showed the definition of the integer notation xyzzyx in base ten and declared it a multiple of 7. I regard that as merely stating the question, so this is basically one of those "I don't know how to start" questions. If I had gotten here earlier I would have asked them what the rule for divisibility by 7 is. Since they said they tried it, they ought to at least be able to show what it is. In the process of doing so, they might realize that their "try" had merely been remembering that a rule exists. – David K Nov 21 '23 at 22:37
  • If merely reading a complete solution were sufficient to learn how to solve things, teachers would not need to assign exercises. They could just tell students to read the textbook. – David K Nov 21 '23 at 22:39
  • 1
    @DavidK. Fair enough. It seems we do not see eye-to-eye on this issue. I accept that some users may genuinely not have any idea how to proceed in applying definitions, and so I cut them a bit more slack in terms of the depth of their own working. I am also more cautious in applying absolutes such as "[...] teachers would not need to assign exercises", as each student is different and have different aptitudes. I don't presume to know OP's, and so I answered the question in the way I myself would find most illustrative. Cheers :) – H. sapiens rex Nov 21 '23 at 23:14
  • 1
    To correctly support your argument you need to invoke the divisibility test in bidirectional form, i.e. $,7\mid n\iff 7\mid f(n),,$ not $,7\mid n\Leftarrow 7\mid f(n)\ \ $ – Bill Dubuque Nov 22 '23 at 00:56
  • 1
    I respect that we have differing opinions. I also don't believe in absolutes: some students may be perfectly capable of learning skills without having exercises set for them (though I think those students also would be very unlikely to ask a question in the way this one is asked). I do believe in a more interactive form of engagement in cases like this, that's all. Thanks for the polite exchange of viewpoints! – David K Nov 22 '23 at 02:01
  • @DavidK no worries, and thank you for the same! I dislike when differences of opinion devolve into pointless tit-for-tat (which I find to be sadly common, even on this site) so to be able to exchange ideas like this feels really good :) make no mistake, you have given me food for thought and I intend to digest it ;) – H. sapiens rex Nov 22 '23 at 04:18