First, an auxiliary function that mimics what your division example, i.e. multiplies the dividend by 10 whenever it is smaller than the divisor, and returns only the remainder.
columnDivRem[a_, b_] /; a < b := QuotientRemainder[10 a, b][[2]]
columnDivRem[a_, b_] := QuotientRemainder[a, b][[2]]
Then the "main" function, without If's or Do's, that repeatedly applies this function to it's own results until one of the remainders is a duplicate, or a zero remainder is found.
columnDiv = Function[{div1, div2},
NestWhileList[columnDivRem[#, div2] &,
div1, ({##} === DeleteDuplicates@{##} && FreeQ[{##}, 0]) &,
All, 1000]]
columnDiv[37, 22]
(* {37, 15, 18, 4, 18} *)
NestWhileList's last parameter prevents the function from executing indefinitely, such as in @Daniel Lichtblau`s evil example, by limiting the number of executions to 1000:
columnDiv[773240, 68423]
{773240,20587,601,6010,60100,53616,57199,<<987>>,67534,59533,47946,499,4990,49900,20039}
Fixed-point version, inspired by @Daniel Lichtblau
columnDivFixed = Function[{div1, div2},
FixedPoint[Append[#, columnDivRem[Last@#, div2]] &, {div1}, 1000,
SameTest -> (#1 === DeleteDuplicates@#2 || Last@#2 == 0 &)]];
Out[296]= {{773240, 68423}, {11, 20587}, {0, 11}}`
– Daniel Lichtblau Nov 25 '14 at 20:01