$z=100^2-x^2$. Then, how many values of $x,z$ are divisible by $6$?

My approach:

For $x=1$, $z$ is not divisible by $6$.

For $x=2$, $z$ is divisible by $6$.

For $x=3$, $z$ is not divisible by $6$.

For $x=4$, $z$ is divisible by $6$.

For $x=5$, $z$ is not divisible by $6$.

For $x=6$, $z$ is not divisible by $6$.

For $x=7$, $z$ is divisible by $6$.

For $x=8$, $z$ is divisible by $6$.

I could not identify the pattern in these questions. Also can this problem be solved with a better approach?

  • $\begingroup$ Why wouldn't you start with 100 mod 6 as a starting point? That simplifies this greatly as this would leave you with at most 6 cases to consider. $\endgroup$
    – JB King
    Aug 27, 2015 at 5:53
  • $\begingroup$ @JBKing Please Explain in detail i haven't understood.The Ans is 66 $\endgroup$
    – Jack
    Aug 27, 2015 at 8:06
  • $\begingroup$ Did you leave out some pieces? You didn't state in the question whether or not negative values are acceptable for $x$ and $z$ which may be what some of us would presume. $\endgroup$
    – JB King
    Aug 27, 2015 at 15:59
  • $\begingroup$ @Jack At x=4 and At x=7 z is not divisible. $\endgroup$ Aug 29, 2015 at 4:15

3 Answers 3




As $(100-x)+(100+x)=200,100\pm x$ have same parity and

if one is divisible by $3,$the other is not

So if $2|z,100\pm x$ must be even

If $3|z,3|(100-x)(100+x)\implies$

either $3|(100-x)\iff x\equiv1\pmod3$

or $3|(100+x)\iff x\equiv-1\pmod3$

  • 2
    $\begingroup$ Not understood please explain in detail?.Why u added (100+x)+(100-x)=200,100+-x.What is 2lz,3lz,3l? $\endgroup$
    – Jack
    Aug 27, 2015 at 8:19
  • $\begingroup$ @lab bhattacharjee I also not understood the solution.Can anybody else explain clearly.I didn't got $100+-x$.When i put x=0,i got x=200.What does parity mean here. $\endgroup$ Aug 29, 2015 at 4:18
  • $\begingroup$ @Jack, $a|b$ means $a$ divides $b$ Sorry for the confusion $\endgroup$ Aug 29, 2015 at 4:23
  • $\begingroup$ @justintakro, parity means even or odd. What's ur confusion? $\endgroup$ Aug 29, 2015 at 4:24
  • $\begingroup$ @lab bhattacharjee When u put x=0,you get 200.Q1 I mean at what value you get $100+-x$.Q2 Can you give an example what this statement mean "if one is divisible by 3,the other is not". $\endgroup$ Aug 29, 2015 at 4:29

Just a different way to highlight what has already been correctly noted, and to explain why the answer could be $66$, as stated in one of the initial comments by the author of the OP. To avoid confusion, I interpreted the problem as the question of how many values of $x$ lead to a positive $z$ that is divisible by $6$.

Let us start from $z=(100-x)(100+x)$, where the two factors $100-x$ and $100+x$ clearly have the same parity. First, we can observe that the only possibility that $z$ is divisible by $6$ occurs when at least one of these two factors is divisible by $6$. In fact, if any of the two factors is divisible by $3$ and not by $2$, the other factor is also not divisible by $2$, and so $z$ cannot be divisible by $6$.

Then, we can note that $100-x$ is divisible by $6$ only when $x=6j+4$ (with $j$ integer), whereas $100+x$ is divisible by $6$ only when $x=6j+2$.

If we limit the problem to solutions that give positive values of $z$ (although this is not specified in the OP), then $|x|$ can only assume integer values $<100$. It is not difficult to note that there are $16$ positive integers $<100$ of the form $x=6j+4$ (they are $4,10,16,22...94$) and $17$ positive integers $<100$ of the form $x=6j+2$ (they are $2,8,14,20...98$). So, there are $33$ positive integer values of $x$ that lead to a $z$ value that is divisible by $6$.

Lastly, because each of these solutions with a given positive $x$ corresponds to another symmetric solution with $-x$, we have to count other $33$ negative values of $x$. This finally leads to a total of $66$ solutions.


I think a good idea for the problem is using modulos. So, the problem can be written like this $$ z=4-x^2 \text{ }mod(6), $$ We know that $100=96+4=4\quad mod(6)$. So $100^2=(100)*(100)=4*4=16=12+4=4\quad mod(6)$. If $z$ is divisible for $6$, then $z=0\quad mod(6)$. For all of this we have to find $x$ such that $$ x^2=4\quad mod(6). $$ We have to make a table where we can analize $x^2\quad mod(6)$.

For $x=0$, $x^2=0$ and $x^2=0\quad mod(6)$.

For $x=1$, $x^2=1$ and $x^2=1\quad mod(6)$.

For $x=2$, $x^2=4$ and $x^2=4\quad mod(6)$.

For $x=3$, $x^2=9$ and $x^2=3\quad mod(6)$.

For $x=4$, $x^2=16$ and $x^2=4\quad mod(6)$.

For $x=5$, $x^2=25$ and $x^2=1\quad mod(6)$.

So, the last proposition implies that $x=2 \quad mod(6)$ or $x=4 \quad mod(6)$.

In summary, if $x=2+6m$ or $x=4+6n$ for $m,n\in\mathbb{Z}$. Then, $z$ is divisible by $6$. There are infinity solutions.

  • 2
    $\begingroup$ Rather than the table, if 6 divides $x^2-4$ then x is even .Let x=2y. So $ 6| (x^2-4)$ iff $ 6|(4y^2-4)$ iff $ 3|(y^2-1) $ iff $ 3|(y-1)(y+1)$ iff $ [3|(y-1)$ or $3|(y+1)$]. $\endgroup$ Aug 27, 2015 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .