How to indicate a condition in sum? I want to sum over all the possible combinations of two numbers that give the same result under a certain formula. Specifically, in this case, sum over all the possible combinations of non-negative integers $i,j\in\mathbb{N}_0$ that together with some constant natural number $n\in\mathbb{N}$ give the same value for the formula $k=n\left(i+j\right)+j$.
I tried the following notation:
$$\sum_{k=n\left(i+j\right)+j}2^k$$ 
But, it seems somewhat ambiguous and unclear, it's not explicit how many and what variables the sum goes over and which are fixed. How do I indicate exactly and clearly my intentions?
Maybe something like:
$${\sum_{i=0}^{\infty}\sum_{j=0}^{\infty}}_{s.t\ n\left(i+j\right)+j=k}2^k$$
 A: Here's one option, using \substack:
$$\sum_{\substack{i\ge 0,\ j\ge 0:\\n\left(i+j\right)+j=k}} 2^k$$
A: 
" I want to sum (what ?) over all the possible combinations of two numbers .."

the what shall be a function $f \, : \, \mathbb {Z}^2 \to \mathbb X$ so you write
$$
S(C) = \sum\limits_{(i,j)\, \in \,C} {f(i,j)} 
$$
where $C$ is a domain in the plane $i,j$ defined by certain conditions.
In the example you give, 
$$
C = \left\{ {(i,j):\left\{ \matrix{
  0 \le i,j \hfill \cr 
  n\left( {i + j} \right) + j = k \hfill \cr}  \right.} \right\}
$$
where $n$ and $k$ are considered as given constants (or parameters), and do not vary while taking the sum.
So by writing
$$
S(C) = \sum\limits_{(i,j)\, \in \,C} {2^{\,k} } 
$$
you are actually telling
$$
S(C) = \sum\limits_{(i,j)\, \in \,C} {2^{\,k} }  = \sum\limits_{(i,j)\, \in \,C} {2^{\,k}  \cdot 1}  = 2^{\,k} \sum\limits_{(i,j)\,} {{\bf 1}_{\left\{ {(i,j)\, \in \,C} \right\}} }  = 2^{\,k} \left| C \right|
$$
i.e., that $f(i,j)=1$, so that when summed over $C$ i it is equivalent to summing the corresponding indicator function
over the whole plane, and finally to give the size of $C$, which is the number of non-negative solutions to the diophantine equation $n\left( {i + j} \right) + j = k$.
A: Following your answer to my comment, I would suggest to write
$$
2^k \bigl|\bigl\{(i,j) \in {\Bbb N}^2 \mid ni + (n+1)j = k\bigr\}\bigr|
$$
