Find nth integer composition I am processing compositions of integer N in K groups in a loop - for bigger K, N, number of compositions is enormous (1,731,030,945,644 for N = 100, K = 10). I would like to split my loop into more loops I can run in parallel. To do this, I need to know, how does the composition at some position look like without looping through all of them first. 
For example to split the process of generating N=100, K=10 compositions into four parallel processing units, I would need to know compositions at positions:
1                 --> this is (91,1,1,1,1,1,1,1,1,1)
432 757 736 411
865 515 472 822
1 298 273 209 233

Is there a way to at least estimate something like this? I am using this algorithm (compnz_next function) to generate compositions.
 A: The number of compositions of $n$ into $k$ parts is $C_k(n) = {n-1 \choose k-1}$. If we assign the first number $q$, then the remaining $k-1$ numbers are a composition of $n-q$. So the number of compositions of the form $(q, \; ... )$ is ${n-q-1 \choose k-2}$. So we just have a scheduling problem, which is easily approximated. For $n=100, \; k=10$ and $m=4$ we have
$$ \begin{array}
((\{14..91\}, \; ...) &\rightarrow& 459856441980 \text{ compositions} \\
(\{7..13\}, \; ...) &\rightarrow& 459856441980 \text{ compositions} \\
(\{3,6\}, \; ...) &\rightarrow& 467308452975 \text{ compositions} \\
(\{1,2\}, \; ...) &\rightarrow& 301886658424 \text{ compositions} \\
\end{array}
$$  
Or using a greedy approach 
$$ \begin{array}
((\{1, 2, 4, 30, 46, 60, 67, 77, 84, 86, 88, 89, 90, 91\}, \; ...) &\rightarrow& 432757736211 \text{ compositions} \\
(\{3, 5, 6, 8, 41, 58, 75, 78, 82, 85, 87\}, \; ...) &\rightarrow& 432757730650 \text{ compositions} \\
(\{7, 9, 10, 11, 12, 13, 25, 48, 61, 68, 79, 80\}, \; ...) &\rightarrow& 432757726750 \text{ compositions} \\
(\{\text{all remaining}\}, \; ...) &\rightarrow& 432757752033 \text{ compositions} \\
\end{array}
$$  
