Hacker News new | ask | show | jobs
by pranaysy 644 days ago
Neat! This is (a+b)(a-b) + b² = a²-b² + b² = a² and in your eg, a=23 and b=3

In addition to using this trick for getting to multiples of 10, I used it to compute the product of two numbers by leveraging their proximity to a number in between whose square I knew. For eg if I need to multiply 23 by 27, I instead see it as (25-2)(25+2), which is 25²-2² = 621.

(using that same trick from the article to calculate squares of numbers that end in 5)

1 comments