Final Power Digits
The sum 1^1 + 2^2 + 3^3 + ... + n^n becomes enormous very quickly. Write a function self_powers_last10 that returns only the last 10 digits of this sum. It is helpful to think of this as taking the sum modulo 10^10. Return the result as an integer.
Примеры
Ввод
10Вывод
405071317Ввод
1000Вывод
9110846700Ввод
1Вывод
1Нужно реализовать
def self_powers_last10(n: int) -> int:
Теги
math
Log ind for at se indsendelseshistorik
Log indLog ind for at bruge AI-mentor
Log indVisible tests
1
Input
10Expected
4050713172
Input
1000Expected
91108467003
Input
1Expected
14
Input
3Expected
325
Input
2Expected
56
Input
999999Expected
4077562500Focus radio
Paused · SomaFM · Fluid