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

 


A039637
Number of steps to fixed point of "n -> n/2 or (n+1)/2 until result is prime".
5
1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 4, 4, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 3, 3, 1, 5, 1, 5, 2, 2, 4, 4, 1, 2, 4, 4, 1, 3, 1, 3, 2, 2, 1, 5, 3, 3, 3, 3, 1, 4, 4, 4, 2, 2, 1, 6, 1, 2, 6, 6, 3, 3, 1, 3, 5, 5, 1, 5, 1, 2, 3, 3, 5, 5, 1, 5, 2, 2, 1, 4, 2, 2, 4, 4, 1, 3, 3, 3, 2, 2, 6, 6, 1, 4, 4, 4, 1, 4
OFFSET
1,4
LINKS
MATHEMATICA
upplist[ n_Integer ] := Length/@Drop[ FixedPointList[ If[ EvenQ[ # ]&&#>2, #/ 2, If[ PrimeQ[ # ]||(#===1), #, (#+1)/2 ] ]&, n, 20 ], -1 ]
PROG
(Haskell)
a039637 1 = 1
a039637 n = snd $ until ((== 1) . a010051 . fst)
(\(x, i) -> ((x + 1) `div` 2 , i + 1)) (n, 1)
-- Reinhard Zumkeller, Nov 17 2013
CROSSREFS
KEYWORD
nonn
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Nov 17 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 22 19:13 EDT 2024. Contains 376138 sequences. (Running on oeis4.)