OFFSET
0,13
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..1000
EXAMPLE
a(12)=3 since 21/12 = 2 with remainder -3.
MATHEMATICA
lnrs[n_]:=Module[{a, b, m}, {a, b}=Sort[{n, IntegerReverse[n]}]; m=Mod[b, a]; Min[ m, a-m]]; Join[{0}, Array[lnrs, 100]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 10 2017 *)
PROG
(PARI) { for (n=0, 1000, x=n; r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); m=min(n, r); a=max(n, r)%m; write("b061649.txt", n, " ", min(a, m-a)) ) } \\ Harry J. Smith, Jul 25 2009
CROSSREFS
KEYWORD
base,easy,nice,nonn
AUTHOR
Erich Friedman, Jun 16 2001
STATUS
approved