0
$\begingroup$

How many numbers $x$ such that $x$ is multiple of $a$ and divisor of $b$?

$a$ and $b$ is given. Can I have a generalized formula?
My Work
This problem is asking about numbers of number $k$ such that $a \mid ak \mid b$, right?
And if $a \not \mid b$ then there is no answer?

  • 0
    Yes, you are right. Now, if $a$ does not divide $b$, the answer is $0$. If $a$ divides $b$, then consider the divisors of $b/a$.2017-02-24
  • 0
    @Crostul Yes.. But I was looking for a generalized formula :(2017-02-24
  • 0
    Do you know how to find how many factors any arbitrary number, such as c, has? x satisfies iff and only if x=ak and ak|b or in other words k|b/a. So how many k|b/a?2017-02-24

2 Answers 2

1

Hint:

If $x$ is a divisor of $b$ and $x$ is a multiple of $a$, then $b$ must be a multiple of $a$.

If $a$ doesn't divide $b$, then we have $0$ such number.

If $a$ divides $b$. suppose $b=ak$. Verify that if $k_1$ is a factor of $k$, then $ak_1$ satisfy the condition. Also check that the condition is necessary.

Hence number of such number would be $\sigma_0\left(\frac{b}a\right)$ where $\sigma_0$ is the divisor function. https://en.wikipedia.org/wiki/Divisor_function

0

As you point out this is impossible if $a \not \mid b $.

So express $a =\prod p_i^{k_i} $ as its unique prime factorization. Then $b=\prod q_j^{m_j}\prod p_i^{k_i+l_i} $ as its unique prime factorization. As $a|b $ we know the $p_i $ in both factorization are the same set of primes, the $q_i $ (if any) are primes dividing $b$ but not $a $. And each $l_i \ge 0$.

So $x$ can be any $x=\prod q_j^{n_j}\prod p_i^{k_i + h_i} $ where $0\le n_j \le m_j$ and $0\le h_i \le l_i $.

So there are $\prod (m_j+1)\prod (l_i +1) $ possible answers.

Example: $a=36$ and $b=720$ then $a=2^2*3^2$ and $b=5*2^4*3^2$ so there are $(1+1)((4-1)+1)((2-2)+1)=2*3*1=6$ possible $x$s. They are $x=5^a2^{2+b}3^2$ where $a=0,1$ and $b=0,1,2$. So $x $ may be $36,72,144,180,360,720$.

===

Oh....DUH! let $c=b/a $. Let $y$ be a factor of $c $. Then $x=a*y$ are the solutions. So there are as many $x$ as there are factors of $c $. And if $c=\prod p_i^{k_i} $ there are $\prod (k_i+1) $ factors of $c$.

So for the example $a=36$ and $b=720$ then $c=b/a =20=2^2*5$. And $c $ has $(2+1)(1+1)=6$ factors. They are: $1,2,4,5,10,20$. So there are $6$ $x $s. They are $1*36,2*36,4*36,5*36,10*36,20*36=36,72,144,180,360,720$.