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!)
A039635 Fixed point of "n -> n/2 or (n+1)/2 until result is prime". 5
1, 2, 3, 2, 5, 3, 7, 2, 5, 5, 11, 3, 13, 7, 2, 2, 17, 5, 19, 5, 11, 11, 23, 3, 13, 13, 7, 7, 29, 2, 31, 2, 17, 17, 5, 5, 37, 19, 5, 5, 41, 11, 43, 11, 23, 23, 47, 3, 13, 13, 13, 13, 53, 7, 7, 7, 29, 29, 59, 2, 61, 31, 2, 2, 17, 17, 67, 17, 5, 5, 71, 5, 73, 37, 19, 19, 5, 5, 79, 5, 41 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MATHEMATICA
upp[ n_Integer ] := FixedPoint[ If[ EvenQ[ # ]&&#>2, #/2, If[ PrimeQ[ # ]||(#=== 1), #, (#+1)/2 ] ]&, n, 20 ]
PROG
(Haskell)
a039635 1 = 1
a039635 n = until ((== 1) . a010051) ((flip div 2) . (+ 1)) n
-- Reinhard Zumkeller, Nov 17 2013
CROSSREFS
Sequence in context: A285708 A072593 A348907 * A303077 A347619 A164858
KEYWORD
nonn
AUTHOR
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 20:35 EDT 2024. Contains 372555 sequences. (Running on oeis4.)