My question is motivated by the following fact (for a couple of proofs see my answer at MSE 1926967; note that this fact also answers the $\ell = 1$ case of MO 265513):
Fact. The set of triangular numbers modulo $n$ yields $\mathbb{Z}/n\mathbb{Z}$ iff $n$ is a power of $2$.
My specific question is whether there is a straightforward way to describe this set given, for example, the prime factorization of $n$. But I also have the broader question:
What else can be said about the set of triangular numbers modulo $n$ as a function of $n$?
For example, when $n$ is odd, we might expect the set to have cardinality around $(n+1)/2$. To illustrate this by way of example, consider $n = 11$, and the first $11$ counting numbers each reduced modulo $11$:
$$1, 2, 3, 4, 5, -5, -4, -3, -2, -1, 0$$
However many distinct elements we have after the first $(n+1)/2$ triangular numbers will be the final total, since (as suggested by the negative notation above) the elements reverse course thereafter, and wend their way back to $0$ at which point they reset as they have formed a cycle.
But I am not only interested in an estimate of the cardinality based on $n$'s parity; I am hoping for the whole shebang! In that spirit:
Q. How can we describe the set of triangular numbers modulo $n$ given $n$'s prime factorization?