Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Nov 17 2013 14:51:22
%S 1,1,1,2,1,2,1,3,3,2,1,3,1,2,2,4,1,4,1,3,3,2,1,4,4,2,2,3,1,3,1,5,5,2,
%T 2,5,1,2,2,4,1,4,1,3,3,2,1,5,5,5,5,3,1,3,3,4,4,2,1,4,1,2,2,6,6,6,1,3,
%U 3,3,1,6,1,2,2,3,3,3,1,5,5,2,1,5,5,2,2,4,1,4,4,3,3,2,2,6,1,6,6,6,1,6
%N Number of steps to fixed point of "n -> n/2 or (n-1)/2 until result is prime".
%H Reinhard Zumkeller, <a href="/A039636/b039636.txt">Table of n, a(n) for n = 1..10000</a>
%t nerlist[ n_Integer ] := Length/@Drop[ FixedPointList[ If[ EvenQ[ # ]&&#>2, #/ 2, If[ PrimeQ[ # ]||(#===1), #, (#-1)/2 ] ]&, n, 20 ], -1 ]
%o (Haskell)
%o a039636 1 = 1
%o a039636 n = snd $ until ((== 1) . a010051 . fst)
%o (\(x, i) -> (x `div` 2 , i + 1)) (n, 1)
%o -- _Reinhard Zumkeller_, Nov 17 2013
%Y Cf. A039634-A039645.
%Y Cf. A010051, A039634, A039637, A039642, A039643.
%K nonn
%O 1,4
%A _Wouter Meeussen_
%E Offset corrected by _Reinhard Zumkeller_, Nov 17 2013