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 A039638 #15 Aug 08 2025 03:19:17 %S A039638 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, %T A039638 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, %U A039638 2,131,67,67,17,17,17,73,19,19,19,79,41,5,173,43,11,179,11,23,47,191 %N A039638 Fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)-1. %H A039638 Reinhard Zumkeller, <a href="/A039638/b039638.txt">Table of n, a(n) for n = 1..10000</a> %t A039638 (* See A039634. *) %t A039638 Table[NestWhile[If[EvenQ[#],#/2,(#-1)/2]&,Prime[n]-1,CompositeQ],{n,80}] (* _Harvey P. Dale_, May 27 2023 *) %o A039638 (Haskell) %o A039638 a039638 1 = 1 %o A039638 a039638 n = until ((== 1) . a010051) (flip div 2) (a000040 n - 1) %o A039638 -- _Reinhard Zumkeller_, Nov 17 2013 %Y A039638 Cf. A039634-A039645. %Y A039638 Cf. A010051, A000040, A039642, A039640, A039634. %K A039638 nonn %O A039638 1,2 %A A039638 _Wouter Meeussen_ %E A039638 Offset corrected by _Reinhard Zumkeller_, Nov 17 2013