Divide p by q: watch the remainders decide if the decimal stops or repeats

17
numerator p denominator q

Remainder wheel: dividing by q, a remainder can only be 0 to q − 1

Long division, step by step

StepDivideDigitRemainder
Try: