code: public static double[] toN(int n) {
          double[] result = new double[n];
          for (int i = 0; i < n; i++) {
              result[i] = i;
          }
          return result;
      }
docs: Returns a double[] initialized with the values from 0 to n-1, inclusive;