DEFDBL A-Z
FOR n = 1 TO 2014
t = t + modpow(n, n + 1, 10000)
NEXT
PRINT t MOD 10000
_clipboard$=str$(t mod 10000)
FUNCTION modpow (b, p, m)
answ = 1
FOR i = 1 TO p
answ = (answ * b) MOD m
NEXT
modpow = answ
END FUNCTION
finds
4311
as the last four digits of the number, so the last digit is a 1.
|
Posted by Charlie
on 2014-07-12 12:30:34 |