OFFSET
0,13
COMMENTS
These numbers have been named "miss numbers" by Hans Havermann, and the individual sequences are called "Digit trails" by Eric Angelini, who asked for those which end in 0 (now listed in A207506).
If we don't stop when reaching a negative number but keep going, it appears that we always do reach 0 eventually -- see A208059.
LINKS
H. Havermann, Table of n, a(n) for n = 0..10000
H. Havermann, in reply to E. Angelini, Re: Subtracting digits, hitting zero, seqfan mailing list, Feb 16 2012
EXAMPLE
35 hits 0 when successively subtracting its own "digit-trail":
a b c
35-3=32
32-5=27
27-3=24
24-2=22
22-2=20
20-7=13
13-2=11
11-4= 7
7-2= 5
5-2= 3
3-2= 1
1-0= 1
1-1= 0 <- hit
We get column b by reading column a digit-by-digit.
So we have 35 -> 32 -> 27 -> 24 -> 22 -> 20 -> 13 -> 11 -> 7 -> 5 -> 3 -> 1 -> 1 -> 0
However, we may not hit 0 exactly, but reach a negative number instead. For n=11, the digit trail sequence is 11, 10, 9, 8, 8, -1, where we stop, and so a(11)=1.
MATHEMATICA
f[n_] := Module[{x = n, l}, l = IntegerDigits[x];
While[x > 0, x = x - First[l];
l = Join[Rest[l], IntegerDigits[x]]; ]; Abs[ x]] ;
Table[f[n], {n, 0, 100}] (* Robert Price, Apr 09 2020 *)
PROG
(PARI) A207505(n, v=0, a=[])={ v&print1(n); a=Vec(Str(n)); while(n>0, a=concat( vecextract(a, "^1"), Vec( Str( n-=eval( a[1] )))); v&print1(", "n)); -n}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Jun 01 2012
STATUS
approved