fn permutations(array: [i64; 5], i: usize, f: &mut impl FnMut([i64; 5]))
Generates all possible permutations of the array, passing them to a callback function.