I've found a solution for fast multiplication n digits with respect to the following conditions:
- have the same number of digits
- the first digit of both numbers are equal
- the sum of last digit of both numbers is 10
Example for applicable numbers could be: 56 x 54, 21 x 29, 37 x 33, 112 x 118, etc.
The algorithm:
56 x 54:
- the next ordinal number that comes after that 5 is 6; so we multiply 5x6 = 30, so we got the first two digits of our product
- the last step is to multiply the units numbers, I mean: 6 x 4 which is 24; so 24 is the last two digits of our product
This mean that 56 x 54 = 3024.
Another example:
21 x 29:
- the next ordinal number that comes after that 2 is 3; so we multiply 2x3 = 6, so we got the first two digits of our product
- the last step is to multiply the units numbers, I mean: 1 x 9 which is 9; because is small than 10 we write down 09 instead of 9
This mean that 21 x 29 = 609.
Another example:
112 x 118:
- the next ordinal number that comes after that 11 is 12; so we multiply 12x11 = 132, so we got the first two digits of our product
- the last step is to multiply the units numbers, I mean: 2 x 8 which is 16
This mean that 112 x 118 = 13216.
When the above conditions are not meet you can still use the other method explained here and here.
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
The following two tabs change content below.
Eugen Mihailescu
Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018