This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A065641 Smallest number with persistence n for the sort-and-subtract-sequence. 4
 0, 1, 10, 60, 90, 101, 120, 380, 450, 505, 807, 1020, 1070, 1303, 1450, 3810, 10020, 10404, 10560, 16056, 16200, 18088, 20322, 20580, 35790, 79000, 80088, 90877, 243700, 279509, 330832, 374330, 380038, 903655, 1002404, 1005064, 1020828 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Sort the digits of an integer and subtract the result from the original. Continue with the result until you reach 0. The sequence gives the least integer that needs n steps to reach 0. LINKS David W. Wilson and Reinhard Zumkeller, Table of n, a(n) for n = 0..100 (a(n) for n = 1..55 from Reinhard Zumkeller). EXAMPLE 60 is the smallest number that needs 3 steps to reach 0: 60 -> 60 - 06 = 54 -> 54 - 45 = 9 -> 9 - 9 = 0, hence a(3) = 60. MATHEMATICA Persist[n_] := Length[NestWhileList[# - FromDigits[Sort[IntegerDigits[#]]] &, n, # != 0 &]] - 1; nn = 20; t = Table[0, {nn}]; cnt = 0; k = 0; While[cnt < nn, k++; c = Persist[k]; If[c <= nn && t[[c]] == 0, t[[c]] = k; cnt++]]; t  (* Harvey P. Dale, Mar 24 2011 *) PROG (Haskell) import Data.List (elemIndex) import Data.Maybe (fromJust) a065641 n = a065641_list !! (n-1) a065641_list = map (fromJust . (`elemIndex` a193582_list)) [1..] -- Reinhard Zumkeller, Aug 10 2011 CROSSREFS Cf. A004185, A193582. Sequence in context: A055714 A046762 A066290 * A121874 A144560 A076160 Adjacent sequences:  A065638 A065639 A065640 * A065642 A065643 A065644 KEYWORD nonn,base,nice AUTHOR Ulrich Schimke (ulrschimke(AT)aol.com), Dec 03 2001 EXTENSIONS Added a(0) = 0. David W. Wilson, Jan 08 2017 STATUS approved

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

Last modified March 19 00:26 EDT 2019. Contains 321305 sequences. (Running on oeis4.)