Created
March 24, 2018 14:03
-
-
Save VincentTam/18f90a605447ead43963baef57bd5103 to your computer and use it in GitHub Desktop.
Sum of digits of p^2016 for some prime p
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Primes | |
plist = primes(1,10000) | |
sumdigits(n, base=10) = sum(digits(n, base)) | |
for p in plist[1:100] | |
sdgit = sumdigits(big(p)^2016) | |
println("$(p), $(log(p)), $(sdgit)") | |
if sdgit == 2017 | |
break | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment