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.

A039638 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, 2, 2, 3, 5, 3, 2, 2, 11, 7, 7, 2, 5, 5, 23, 13, 29, 7, 2, 17, 2, 19, 41, 11, 3, 3, 3, 53, 13, 7, 31, 2, 17, 17, 37, 37, 19, 5, 83, 43, 89, 11, 47, 3, 3, 3, 13, 13, 113, 7, 29, 59, 7, 31, 2, 131, 67, 67, 17, 17, 17, 73, 19, 19, 19, 79, 41, 5, 173, 43, 11, 179, 11, 23, 47, 191
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a039638 1 = 1
    a039638 n = until ((== 1) . a010051) (flip div 2) (a000040 n - 1)
    -- Reinhard Zumkeller, Nov 17 2013
  • Mathematica
    (* See A039634. *)
    Table[NestWhile[If[EvenQ[#],#/2,(#-1)/2]&,Prime[n]-1,CompositeQ],{n,80}] (* Harvey P. Dale, May 27 2023 *)

Extensions

Offset corrected by Reinhard Zumkeller, Nov 17 2013