Most of the examples I see are that of permutations. This query is whether there is a formal formula for a more exhaustive ordering:
Eg:
The set $\{1\}$ is ordered as $\{1\}$. Just one possibility.
The set $\{1,2\}$ can only be ordered as: $\{1\},\{2\},\{1,2\},\{2,1\}$. Four possibilities.
The set $\{1,2,3\}$ can be ordered as:
$\{1\},\{2\},\{3\},\{1,2\},\{2,1\},\{1,3\},\{3,1\},\{2,3\},\{3,2\},\{1,2,3\},\{1,3,2\},\{2,1,3\},\{2,3,1\},\{3,1,2\},\{3,2,1\}$. Fifteen possibilities.
Since the sequence is 1,4 and 15, I'm not sure what formula would apply.
I'm developing a program that randomly generates a few numbers from this set, but to know the total possibilities, I was hoping for a formula which could predict it.
Did you want to count the empty set $\{\}$ as well? If yes, then just start the index $i$ at $0$ instead of $1$ in the below summation.
So far, you're doing $$ \sum_{i=1}^{n} {}^n\text{P}_{i} $$ for each natural number $n \in \mathbb{N}$, where ${}^n\text{P}_{i}$ is the permutation formula given by $$ {}^n\text{P}_{i} = \frac{n!}{(n-i)!}. $$ For example, to get $15$ you're doing $$ \frac{3!}{(3-1)!} + \frac{3!}{(3-2)!} + \frac{3!}{(3-3)!} = \frac{3!}{2!} + \frac{3!}{1!} + \frac{3!}{0!} = 3 + 6 + 6 = 15. $$ I will leave it to you to see how each term corresponds to each set type, and hopefully you can understand where this formula comes from. If not, I'd be happy to elaborate later.