Added all numbers from 1 to number initialized into an array and returned it