1

Find the total number of 3 digit numbers in form of $abc$ such that HCF(a,b,c)=1.

My approach:

Total number of cases=$9^3$ Considering that a,b,c are 0 to 9 and and for the HCF to be 1 there should be no common factor of 2 or 3 .

So total number of cases is equal to

$9^3-3^3-2^3=694 $

Now i might have made a total mess here but i what should be the shortest possible method and obviously the correct answer?

Pole_Star
  • 1,082
  • 1
    Why $9^3$? I can see where $a\neq 0$, but the others? Also, why are you only worried about factors of $2,3$? What about $555$, say? or $700$? – lulu Dec 30 '17 at 15:58
  • Also, if you are trying to use Inclusion-Exclusion (which is a good idea, by the way) then you need to add back the cases you doubled counted. Thus your calculation should have added back the ones where each digit was divisible by $6$. – lulu Dec 30 '17 at 16:01
  • yeah that too...I have left out many many cases – Pole_Star Dec 30 '17 at 16:01
  • So, just do it more carefully. the approach is fine...just needs greater care. – lulu Dec 30 '17 at 16:02
  • I see your point...but this becoming too lengthy and i cant be sure if i am leaving any – Pole_Star Dec 30 '17 at 16:02
  • I am looking for something short and concise where i dont need so many conditions bludgering my head – Pole_Star Dec 30 '17 at 16:03
  • Well, that's the nature of these sort of counting problems. This sample is small enough so that you can do it "by hand", which is to say "using a simple program". Or you could apply your method to two digit numbers where it is easy to actually do it by hand. – lulu Dec 30 '17 at 16:04

1 Answers1

1

For each leading digit from $1$ to $9$ there are $100$ possible integers. If the second and third digits both share a divisor greater than $1$ with the leading digit then we exclude that case.

So if $n$ digits share a divisor with the leading digit, we exclude $n^2$ cases.

$$ \begin{array}{c|crrr} \text{Leading digit} & \text{Excluded digits} & \text{Size} & \text{Size}^2 & 100-\text{Size}^2 \\ \hline 1 & \text{None} & 0 & 0 & 100 \\ 2 & 0,2,4,6,8 & 5 & 25 & 75 \\ 3 & 0,3,6,9 & 4 & 16 & 84 \\ 4 & 0,2,4,6,8 & 5 & 25 & 75 \\ 5 & 0,5 & 2 & 4 & 96 \\ 6 & \text{See below} & & & 63 \\ 7 & 0,7 & 2 & 4 & 96 \\ 8 & 0,2,4,6,8 & 5 & 25 & 75 \\ 9 & 0,3,6,9 & 4 & 16 & 84 \\ Total & & & & 748 \\ \end{array} $$

The leading digit of $6$ is a special case because both $2$ and $3$ are divisors. We can use Inclusion-Exclusion.

Exclude $\{0,2,4,6,8\}$ for $25$ cases. Exclude $\{0,3,6,9\}$ for $16$ cases. But $\{0,6\}$ has been double-counted so add back $4$ cases. $100-25-16+4=63$

nickgard
  • 4,116