sum = 0 (1...333).each do |t| sum += 3 * t end (1... 195).each do |t| sum += 5 * t end