login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A207505 Start with n, successively subtract the next digit of the resulting sequence, stop when reaching zero or less: a(n) is the absolute value of the result. 3
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 1, 0, 1, 2, 3, 4, 5, 0, 0, 7, 0, 0, 1, 0, 0, 7, 6, 6, 6, 3, 2, 1, 0, 0, 1, 0, 4, 3, 2, 1, 1, 0, 0, 2, 1, 5, 4, 2, 0, 2, 1, 0, 2, 0, 0, 4, 2, 0, 1, 1, 7, 4, 1, 0, 4, 3, 0, 2, 0, 2, 1, 0, 0, 7, 1, 1, 3, 0, 1, 4, 3, 2, 2, 5, 2, 6, 1, 2, 5, 0, 4, 3, 2, 1, 0, 7, 6, 5, 5, 2, 5, 5, 1, 3, 3, 4, 1, 3, 0, 6, 0, 5, 3, 8, 3, 5, 4, 4, 4, 3, 2 (list; graph; refs; listen; history; text; internal format)
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, 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
Sequence in context: A283001 A037851 A037887 * A235049 A031087 A010878
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Jun 01 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:28 EDT 2024. Contains 371967 sequences. (Running on oeis4.)