Fastest algorithm to compute the square of a number

444 Views Asked by At

It is well-known that the time complexity of computing the product of two distinct n-digit natural numbers is $O(n\log{n})$ and is also conjectured to be $Ω(n\log{n})$. Is the time complexity of computing the square of an $n$-digit natural number less than O(nlogn)? Is there a specific algorithm for computing the square of an $n$-digit natural number, rather than using multiplication algorithms for two random $n$-digit numbers? $\ $(I don't know if the answer is obvious and I can't find anything on the internet about this)

What is the time complexity of computing $N^2$, where N is an $n$-digit natural number?

1

There are 1 best solutions below

2
On BEST ANSWER

If you could compute squares quickly then you could compute products quickly since $$ ab = \frac{(a+b)^2 - a^2 -b^2}{2} , $$