Power Digit Sum¶
Since Python/SageMath support integers of arbitrary size, this problem is pretty straightforward. Just compute $2^{1000}$ directly and sum the digits up.
In [1]:
n = 2 ^ 1000
total = 0
while n != 0:
total += n % 10
n //= 10
print(total)
1366
Relevant sequences¶
- Sums of digits of $2^n$: A001370
Copyright (C) 2025 filifa¶
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license and the BSD Zero Clause license.