Checking validity of NHS numbers

You probably want the Enumerable#each_with_index method, eg.

new_array = []

[1, 2, 3, 4, 5, 6, 7, 8, 9, 0].each_with_index do |value, index|
new_array.push(value * (10 - index))

end

James.