Skip to content

Instantly share code, notes, and snippets.

@VincentTam
Created March 24, 2018 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentTam/18f90a605447ead43963baef57bd5103 to your computer and use it in GitHub Desktop.
Save VincentTam/18f90a605447ead43963baef57bd5103 to your computer and use it in GitHub Desktop.
Sum of digits of p^2016 for some prime p
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