login
Persistence of n for sort-and-subtract (A193581).
4

%I #7 Jul 13 2013 12:04:14

%S 0,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,1,

%T 1,1,1,1,1,1,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,1,1,1,1,1,3,2,2,2,2,2,1,1,

%U 1,1,3,3,2,2,2,2,2,1,1,1,3,3,3,2,2,2

%N Persistence of n for sort-and-subtract (A193581).

%C Number of sort-and-subtract steps to reach 0 when starting with n.

%H Reinhard Zumkeller, <a href="/A193582/b193582.txt">Table of n, a(n) for n = 0..10000</a>

%o (Haskell)

%o a193582 n = length $ takeWhile (> 0) $ iterate a193581 n

%o a193582_list = map a193582 [0..]

%Y Cf. A004185.

%K nonn,base

%O 0,11

%A _Reinhard Zumkeller_, Aug 10 2011