im looking for efficient algorithm to expand $(x+a)^n$ without using binomial theorem

is the repeating square method efficient for that problem with the help of binary representation of n ?

  • $\begingroup$ This is very easy to find out. Just do it and count the operations. $\endgroup$ – gnasher729 Nov 26 '16 at 13:35
  • 5
    $\begingroup$ Can you edit your question to clarify what you are asking? What counts as "expanding $(x+a)^n$"? What are the inputs, and what is the desired output? Do you mean, given numbers $x,a,n$, you want to compute the value of $(x+a)^n$? Or do you mean that, given the number $n$, you want to compute a symbolic expression for $(x+a)^n$, e.g., outputting a string like x^n + n * a * x^(n-1) + ... with the ... filled in appropriately? $\endgroup$ – D.W. Nov 26 '16 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.