![]() |
VOOZH | about |
Nicomachus's Theorem states that sum of cubes of first n natural numbers is equal to squares of natural number sum.
In other words
Or we can say that the sum is equal to square of n-th triangular number.
Mathematical Induction based proof can be found here.
Yes
Time complexity : O(n)
Auxiliary Space : O(1)