In this thread, a bijective function is requested which, given two positive integers $n$ and $k$, maps between natural-number identifiers and sequences of $k$ positive integers that sum to $n$. Due to it being a bijection, one could enumerate the natural numbers from $1$ to $\binom{n+k-1}{k-1}$ and run the inverse of this function, generating a different sequence each time.
Importantly, in that thread, zero is allowed and order matters: in the example given, $[0,0,3]$ has an identifier, and it differs from $[3,0,0]$. I now instead want an algorithm that that does not produce permutations of sequences and does not use zeroes, or equivalently, that only produces those sequences of (1) strictly positive integers that (2) are of length $k$ and (3) sum to $n$ while (4) being sorted.
The lack of zeroes simplifies the amount of possible sequences to $\binom{n-1}{k-1}$ (i.e. how many different ways $k-1$ dividers can be placed between a sequence of $n$ "1" characters). It does not suffice to just generate all $\binom{n-1}{k-1}$ sequences and quietly discarding the unsorted ones, because this takes too long. If you run the Python code below for the example of $n = 11$ and $k=6$, you will see that it takes 252 iterations just to generate the 7 unique ordered sequences of 6 integers that sum to 11. I don't know by what formula you could obtain that 7 explicitly, but I suspect it scales much better w.r.t. $n$ and $k$ than does $\binom{n-1}{k-1}$.
from itertools import combinations
n = 11
k = 6
all_sequences = []
for indices in combinations(range(1,n), r=k-1):
indices = (0,) + indices + (n,)
integers_to_sum = tuple([b-a for a,b in zip(indices[:-1], indices[1:])])
all_sequences.append(integers_to_sum)
print(sorted(all_sequences))
print(len(all_sequences))
all_sequences = set(map(tuple, map(sorted, all_sequences)))
print(sorted(all_sequences))
print(len(all_sequences))
r = k
tor = k-1
fixes it. $\endgroup$