Calculate just the digits in product of two numbers

68 Views Asked by At

Given two numbers, let's say in the form of $m=(10a+b)$ and $n=(10c+d)$, is there any way to calculate individual digits (the second digit for example) in the product of $m$ and $n$ without calculating the entire product?

I understand that the product of $m$ and $n$ will be in the form of $[100ac + 10(ad+bc) + bd]$, but I am not sure about what I could do with this next

1

There are 1 best solutions below

0
On BEST ANSWER

The answer depends on whether you have a carry or not. Assuming $0\leq b,d\leq 9$, let $r$ be the remainder of dividing $ad+bc$ by $10$. The second digit is then:

  1. $r+1$ if $bd\geq 10$ and $r\leq 8$.
  2. $0$ if $bd\geq 10$ and $r=9$.
  3. $r$ if $bd\leq 9$.