This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A039642 #12 Aug 08 2025 03:23:28 %S A039642 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 A039642 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 A039642 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 A039642 Number of steps to fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)-1. %H A039642 Reinhard Zumkeller, <a href="/A039642/b039642.txt">Table of n, a(n) for n = 1..10000</a> %t A039642 (* See A039636. *) %o A039642 (Haskell) %o A039642 a039642 1 = 1 %o A039642 a039642 n = snd $ until ((== 1) . a010051 . fst) %o A039642 (\(x, i) -> (x `div` 2 , i + 1)) (a000040 n - 1, 1) %o A039642 -- _Reinhard Zumkeller_, Nov 17 2013 %Y A039642 Cf. A039634-A039645. %Y A039642 Cf. A010051, A000040, A039638, A039644, A039636. %K A039642 nonn %O A039642 1,3 %A A039642 _Wouter Meeussen_ %E A039642 Offset corrected by _Reinhard Zumkeller_, Nov 17 2013