I want to generate $n$ random numbers $u_i \in [ 0, 2^{\kappa + 1})$ such that $\sum u_i = c$ $mod$ $2^{\kappa + 1} $, where c is a constant.
Also, taking $n - 1$ random numbers and subtracting their sum from $b \cdotp 2^{\kappa + 1} + c$, where $b \cdotp 2^{\kappa + 1}$ is the closest multiple of $\;2^{\kappa + 1}$ that is greater than sum of the $n - 1$ random numbers, to get the $n^{th}$ random number a good solution?
P.S. I want to know if there's a solution to this problem that'll ensure good statistical properties.