defsum_divisions(n)(1...n).select{|i|n%i==0}.sumenddefperfect_number?(n)n==sum_divisions(n)end(1..10_000).eachdo|i|puts"#{i} is perfect"ifperfect_number?(i)end
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Translate yours in Ruby.