cp's OEIS Frontend

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.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a039642 1 = 1
    a039642 n = snd $ until ((== 1) . a010051 . fst)
                      (\(x, i) -> (x `div` 2 , i + 1)) (a000040 n - 1, 1)
    -- Reinhard Zumkeller, Nov 17 2013
  • Mathematica
    (* See A039636. *)

Extensions

Offset corrected by Reinhard Zumkeller, Nov 17 2013