WMA link
QuotientRemainder[m, n]
Plot showing the repeated step-like nature of QuotientRemainder:
QuotientRemainder
DiscretePlot[First[QuotientRemainder[n, 5]], {n, 0, 30}]
DiscretePlot[Last[QuotientRemainder[n, 5]], {n, 0, 30}]
QuotientRemainder[23, 7]