A custom function to randomly generate a value once and return the same value for every invocation, per index.