The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A038571 Number of times n must be differentiated to reach 0. 4

%I #12 Mar 04 2020 22:49:45

%S 0,1,2,1,3,2,2,1,4,3,2,3,3,2,2,1,5,4,4,3,3,2,3,4,4,3,2,3,3,2,2,1,6,5,

%T 4,5,4,5,3,4,4,3,2,3,3,4,4,5,5,4,4,3,3,2,3,4,4,3,2,3,3,2,2,1,7,6,6,5,

%U 4,5,6,5,4,5,6,5,3,4,4,5,5,4,4,3,3,2,3,4,4,3,5,4,5,4,5,6,6,5,4,5,4,5,3,4,4

%N Number of times n must be differentiated to reach 0.

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

%t dtn[ L_ ] := Fold[ 2#1+#2&, 0, L ]; f[ n_ ] := dtn[ Map[ Abs[ #[ [ 1 ] ]-#[ [ 2 ] ] ]&, Partition[ IntegerDigits[ n, 2 ], 2, 1 ] ] ]; g[ n_ ] := Length[ FixedPointList[ f, n ] ]-2; Table[ g[ n ], {n, 0, 120} ]

%o (Haskell)

%o a038571 n = snd $ until

%o ((== 0) . fst) (\(x, i) -> (fromIntegral $ a038554 x, i + 1)) (n, 0)

%o -- _Reinhard Zumkeller_, Mar 06 2013

%Y Cf. A038554.

%K nonn,easy,nice

%O 0,3

%A _N. J. A. Sloane_

%E More terms from _Erich Friedman_

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 June 7 12:16 EDT 2024. Contains 373173 sequences. (Running on oeis4.)