Even with the original formulation, the array doesn't have to fit in available memory. mmap exists.
You are given a magnetic tape containing a list of n - 1 integers… :-)