Triangular mod n
Below is a generator that will produce the triangular numbers mod n. This forms a 2n periodic sequence in residue values. The triangular numbers up to 2n themselves are given first. This is followed by the first period of ordered sequence of those numbers. Below that is the set of distinct residues in the period. Finally the saturation, s, is given. This is defined as the length of the set of distinct values divided by n.
Below is a generator that produces the sequence of residues for the nth triangle number, T(n) mod j for j from 1 to T(n).