login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A039636 Number of steps to fixed point of "n -> n/2 or (n-1)/2 until result is prime". 6
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

MATHEMATICA

nerlist[ n_Integer ] := Length/@Drop[ FixedPointList[ If[ EvenQ[ # ]&&#>2, #/ 2, If[ PrimeQ[ # ]||(#===1), #, (#-1)/2 ] ]&, n, 20 ], -1 ]

PROG

(Haskell)

a039636 1 = 1

a039636 n = snd $ until ((== 1) . a010051 . fst)

                        (\(x, i) -> (x `div` 2 , i + 1)) (n, 1)

-- Reinhard Zumkeller, Nov 17 2013

CROSSREFS

Cf. A039634-A039645.

Cf. A010051, A039634, A039637, A039642, A039643.

Sequence in context: A275761 A232396 A270096 * A322866 A328847 A331175

Adjacent sequences:  A039633 A039634 A039635 * A039637 A039638 A039639

KEYWORD

nonn

AUTHOR

Wouter Meeussen

EXTENSIONS

Offset corrected by Reinhard Zumkeller, Nov 17 2013

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 24 01:41 EDT 2021. Contains 346269 sequences. (Running on oeis4.)