123456789101112131415161718192021 |
- #!/usr/bin/ruby
- # Daniel "Trizen" Șuteu
- # License: GPLv3
- # Date: 28 January 2017
- # https://github.com/trizen
- # https://projecteuler.net/problem=63
- # Runtime: 0.158s
- var count = 0
- for n in (1 .. 9) {
- for p in (1 .. 3*n) {
- n**p -> len == p && ++count
- }
- }
- say count
|