Skip to content

Instantly share code, notes, and snippets.

@russelnickson
Created December 1, 2009 19:43
Show Gist options
  • Save russelnickson/246569 to your computer and use it in GitHub Desktop.
Save russelnickson/246569 to your computer and use it in GitHub Desktop.
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000??
a=2**1000
b=0
while a:
b=b+a%10
a/=10
print b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment