This function creates a sequential list of numbers then shuffles, removes one, and duplicates one into another list.
The challenge is to find the missing number and the duplicated number in the shuffled list.
Number list generator
number_list_generator () {
# given an order of magnitude, set output file names
local LC_ALL=C
local oom=${1:-3}
local nums=nums.1e${oom}.txt
local nums_shuf=${nums/txt/shuf}.txt
# create a sequence of numbers
time -p seq 1 1e${oom} > ${nums}
# shuffle, removing one and creating one duplicate ( too lazy to shuffle again or randomly pick number to duplicate )
time -p < ${nums} shuf | sed 1d | sed 100p > ${nums_shuf}
}