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!)
A039642 Number of steps to fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)-1. 4

%I #9 Nov 17 2013 14:53:16

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

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

%U 2,4,6,2,6,5,4,2,3,8,8,8,6,6,3,6,3,6,7,7,7,7,2,2,7,4,5,2,3,9,9,4,6,3

%N Number of steps to fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)-1.

%H Reinhard Zumkeller, <a href="/A039642/b039642.txt">Table of n, a(n) for n = 1..10000</a>

%t see A039636.

%o (Haskell)

%o a039642 1 = 1

%o a039642 n = snd $ until ((== 1) . a010051 . fst)

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

%o -- _Reinhard Zumkeller_, Nov 17 2013

%Y Cf. A039634-A039645.

%Y Cf. A010051, A000040, A039638, A039644, A039636.

%K nonn

%O 1,3

%A _Wouter Meeussen_

%E Offset corrected by _Reinhard Zumkeller_, Nov 17 2013

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 31 22:12 EDT 2024. Contains 373007 sequences. (Running on oeis4.)