maths: range & randperm interfaced