操作
Problem 48¶
Self Powers¶
The series, $1^1 + 2^2 + 3^3 + \cdots + 10^{10} = 10405071317$.
Find the last ten digits of the series, $1^1 + 2^2 + 3^3 + \cdots + 1000^{1000}$.
自身のべき乗(self powers)¶
次の式は, $1^1 + 2^2 + 3^3 + \cdots + 10^{10} = 10405071317$ である.
では, $1^1 + 2^2 + 3^3 + \cdots + 1000^{1000}$ の最後の10桁を求めよ.
(import (scheme base)
(gauche base))
(define answer-48
(mod (apply + (map (^n (expt n n))
(iota 1000 1)))
10_000_000_000))
(format #t "48: ~d~%" answer-48)
Noppi が2024/01/17に更新 · 1件の履歴