Let $(k_0,k_1,k_2\dots) $ be an ordered set of non-negative integer numbers. Let $A (N,K)$ be the number of distinct $k $-sets such that $$\sum_i k_i=K, \quad\sum_i i k_i=N.\tag{1} $$
Is there a special name for $A (N,K)$ and what is the most effective way to compute its value for given $K$ and $N$? Is there an effective way to construct all $k$-sets satisfying (1).
The following table shows $A(N,K)$ for $0\le N,K\le11$:
$$ \left(\begin{array}{rrrrrrrrrrrr} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ 0 & 1 & 2 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 \\ 0 & 1 & 3 & 4 & 5 & 5 & 5 & 5 & 5 & 5 & 5 & 5 \\ 0 & 1 & 3 & 5 & 6 & 7 & 7 & 7 & 7 & 7 & 7 & 7 \\ 0 & 1 & 4 & 7 & 9 & 10 & 11 & 11 & 11 & 11 & 11 & 11 \\ 0 & 1 & 4 & 8 & 11 & 13 & 14 & 15 & 15 & 15 & 15 & 15 \\ 0 & 1 & 5 & 10 & 15 & 18 & 20 & 21 & 22 & 22 & 22 & 22 \\ 0 & 1 & 5 & 12 & 18 & 23 & 26 & 28 & 29 & 30 & 30 & 30 \\ 0 & 1 & 6 & 14 & 23 & 30 & 35 & 38 & 40 & 41 & 42 & 42 \\ 0 & 1 & 6 & 16 & 27 & 37 & 44 & 49 & 52 & 54 & 55 & 56 \\ \end{array}\right) $$ By numerical evidence the following recurrence relation applies: $$ A(N,K)=A(N,K-1)+A(N-K,K),\tag{2} $$ with the convention $A(N,K)=0$ for $N<0$.
$A(N,K)$ can be interpreted as the overall number of possible outcomes of putting $N$ indistinguishable balls into $K$ indistinguishable bins, $k_i$ being the number of bins containing $i$ balls.
Thus, $A(N,K)$ is nothing else as the number of partitions of $N$ into $K$ non-negative summands.
The bijection between the integer partitions of $N$ into $K$ non-negative parts and $k$-sets can be established as follows. Let $n=(n_1,n_2,\dots,n_K)$ be such a partition ($\sum_{j=1}^K n_j=N $). Introduce function $f:\ n\mapsto(k_0,k_1,k_2\dots)$ which for all $i\ge0$ assigns $k_i$ to the count of occurrences (multiplicity) of the number $i$ in the partition $n:\ k_i=\sum_{j=1}^K\delta_{in_j}$. By construction $k_i\ge0$, $\sum_{i\ge0 }k_i=K$, and $\sum_{i\ge0 }i k_i=N$. Obviously the function is bijective.
The described procedure represent probably the most efficient way to construct $k$-sets for given $N$ and $K$ provided an effective method to partition integer numbers into non-negative (or positive) summands.
The proof of the recurrence relation (2) can be carried out as follows. $A(N,K)$ is the number of partitions of $N$ into $K$ non-negative parts. The partitions can be subdivided in those which have at least one summand equal to 0 and those which have only positive summands. In the latter case we can subtract 1 from every summand to get the partition of $N-K$ into $K$ parts. In the former case we can consider 0 as a given part and reduce the problem to partitioning of the number $N$ into $K-1$ parts.