Generating series of integers with a specified sum If I say that 6 positive integers were added together to get a total of 200.
let count = 6
let sum = 200
I have 2 questions
First of all, is there a formula for generating a list of all the possible series of 6 integers whose sum is 200 in a determined manner starting with 0,0,0,0,0,200 and ending with 200,0,0,0,0,0
Secondly, assume each series in the list were numbered serially such that
T1 = {0,0,0,0,0,200}
T2 = {0,0,0,0,1,199}
T3 = {0,0,0,1,1,198}
T4 = {0,0,1,1,1,197}
Tn = {200,0,0,0,0,0}
Is there a relationship between the serial numbers and the series and is this relationshp reversible. For example, is there a formula I can use to generate the third series given the sum of 200, count of 6 and serial 3 (T3) and is there a reversible formula for arriving at the serial 3 (T3) given the sum 200, count 6 and series {0,0,0,1,1,198}.
I hope the question is clear enough but I believe the above is possible depending on how you generate the list of series. 
I'm trying to achieve this in code without having to use loops to brute force the answers.
 A: If one want to count ways of generating a list (not a set: order matters) of $k=6$ non-negative numbers such that their sum is $n=20$ , we are speaking of weak compositions.
The total number is given by an "star and bars" argument as:
$$ {n+k-1 \choose k-1}={205 \choose 6}$$ 
To enumerate those compositions there are several algorithms, none very straightforward. To map each particular combination to a particular "configuration" is straightforward, once you understand the star and bars argument.
A: The number of $n$-tuples of nonnegative integers summing to $N$ is $N+n-1 \choose n-1$ (by the standard "stars-and-bars" argument).  Call this $A(n,N)$.
Note that there are $A(n-1,N-x)$ of these where the first integer is $x$.  To get the $k$'th in lexicographic order, take $x_1$  such that
$$ \sum_{i=0}^{x_1-1} A(n-1,N-i) < k \le \sum_{i=0}^{x_1} A(n-1,N-i)$$
Then $x_2, \ldots, x_n$ form the $(k - \sum_{i=0}^{x_1-1} A(n-1,N-i))$'th $n-1$-tuple whose sum is $N - x_1$. 
A: I think this problem can be more fully understood by using stars and bars. Lets look at the case when there are $3$ numbers that add up to $10$. 
Consider the following lists:
$(2,3,1),(10,0,0)(0,0,10)(5,0,5)$
Using stars and bars they are represented as:
$**|***|*$
$**********||$
$||**********$
$*****||*****$
Notice in the representations there are $10$ stars and $2$ bars, to separate the the stars in three spaces.
Looking at these representations we can assign to each sequence a two number code, which tells us which of the twelve positions are occupied by the bars (in increasing order).
So the codes for the sequences would be:
$3,7$
$10,11$
$1,2$
$6,7$
It should also be clear that the lexicographical order of the lists is the same as the lexicographical order of the codes. So for example, since $2,3,1$ has a lower lexicographical order than $5,0,5$ we also have that the code $3,7$ has a lower lexicographical order than $6,7$
So we can now work with the codes instead of the sequences. So instead of asking ourselves which is the sequence $7$ we can ask ourselves which is code number $7$. And this is a simpler problem.
Why? Suppose we are given a code, for example $3,7$ which number does it occupy? Well, the number is equal to the number of codes that are below it plus one. So how many codes are before $3,7$?
Given a code that is smaller  $3,7$ Look at the first number in which it is different. and classify the smaller sequences according to this.
For example, how many codes are smaller than $3,7$ from the first digit? this is the same as the codes that start with $1$ or $2$, there are $\binom{12}{2}-\binom{10}{2}$ such sequences.
How many sequences are smaller than $3,7$ from the second sequence? They need to start with $3$ and then have a number between $4$ and $6$. How many of these are there? There are $3$ clearly, then thee code $3,7$ is at position $\binom{12}{2}-\binom{10}{2}+3+1$
In general the code $(a_1,a_2\dots a_n)$ when the codes have digits ranging from $1$ to $m$ is going to be $\binom{m}{n}-\binom{m-a_1+1}{n}+\sum\limits_{k=2}^n\binom{m-a_{k-1}}{n-k+1}-\binom{m-a_k}{n-k+1}$
