login
A039638
Fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)-1.
4
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,2
LINKS
MATHEMATICA
see A039634.
Table[NestWhile[If[EvenQ[#], #/2, (#-1)/2]&, Prime[n]-1, CompositeQ], {n, 80}] (* Harvey P. Dale, May 27 2023 *)
PROG
(Haskell)
a039638 1 = 1
a039638 n = until ((== 1) . a010051) (flip div 2) (a000040 n - 1)
-- Reinhard Zumkeller, Nov 17 2013
CROSSREFS
KEYWORD
nonn
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Nov 17 2013
STATUS
approved