numSquare function returns an array of all perfect square numbers that are <= a maxNumber.