123456789101112131415161718192021 |
- #!/usr/bin/ruby
- # Daniel "Trizen" Șuteu
- # https://github.com/trizen
- # What is the value of the first triangle number to have over five hundred divisors?
- # https://projecteuler.net/problem=12
- # Runtime: 0.263s
- var n = 0
- Inf.times { |k|
- n += k
- if (n.sigma0 > 500) {
- say n
- break
- }
- }
|