Skip to content

Instantly share code, notes, and snippets.

@powerwlsl
Last active May 1, 2018 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save powerwlsl/dd3d5e199645ee1f49701ea996893aec to your computer and use it in GitHub Desktop.
Save powerwlsl/dd3d5e199645ee1f49701ea996893aec to your computer and use it in GitHub Desktop.
tmp = a^n
answer = tmp
for (i = 1; i <= n; i += 1) {
tmp = (tmp * (n-i+1) * x )/(a * i)
answer = answer + tmp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment