Is there a way in a permanent workspace to do arbitrary size and arbitrary basic transformations. That is, to convert a sequence of numbers n in the range [1,m] into a sequence of numbers ceiling(n*log(m)/log(p)) in the range [1,p] using a 1 to 1 mapping that (preferably, but not necessarily) lexicographic custodians and gives consistent results?
I am particularly interested in solutions that are viable as a function of the pipe, for example, ei can process a larger data set than can be stored in RAM.
I found a number of solutions that require a "workspace" proportional to the size of the input, but so far this cannot go away with a permanent "workspace".
Does limiting consecutive constraints eliminate? That is: they allow lexicographically sequential inputs to lead to non-lexicographically sequential outputs:
F(1,2,6,4,3,7,8) -> (5,6,3,2,1,3,5,2,4,3) F(1,2,6,4,3,7,9) -> (5,6,3,2,1,3,5,2,4,5)
some thoughts:
Could this work?
streamBase n -> convert ( n , lcm(n,p) ) -> convert ( lcm(n,p) , p ) -> streamBase p
(where lcm is the smallest common multiple)