123456789101112131415 |
- #!/usr/bin/ruby
- # Author: Daniel "Trizen" Șuteu
- # License: GPLv3
- # Website: https://github.com/trizen
- # However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433 × 2^7830457 + 1.
- # Find the last ten digits of this prime number.
- # https://projecteuler.net/problem=97
- # Runtime: 0.130s
- say ((28433 * powmod(2, 7830457, 10**10))+1 % 10**10)
|