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 A181715 #43 Nov 24 2021 08:18:22 %S A181715 3,2,1,2,1,1,1,3,1,1,2,2,1,1,1,1,1,1,1,1,1,3,1,1,2,1,1,1,1,1,1,1,1,2, %T A181715 1,1,2,1,1,1,1,1,1,1,1,2,2,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,2,1,1,1,3,2, %U A181715 1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,3,1,1,1 %N A181715 Length of the complete Cunningham chain of the second kind starting with prime(n). %C A181715 Number of iterations x -> 2x-1 needed to get a composite number, when starting with prime(n). %C A181715 Dickson's conjecture implies that, for every positive integer r, there exist infinitely many n such that a(n) = r. - _Lorenzo Sauras Altuzarra_, Feb 12 2021 %C A181715 a(n) is the least k such that 2^k * (prime(n)-1) + 1 is composite. Note that a(n) is well defined since 2^(p-1) * (p-1) + 1 is divisible by p for odd primes p. - _Jianing Song_, Nov 24 2021 %H A181715 T. D. Noe, <a href="/A181715/b181715.txt">Table of n, a(n) for n = 1..10000</a> %H A181715 G. Löh, <a href="http://www.jstor.org/stable/2008735">Long chains of nearly doubled primes</a>, Math. Comp., 53 (1989), 751-759. %H A181715 Michael Penn, <a href="https://www.youtube.com/watch?v=P0G39kdqmbg">Romanian Mathematical Olympiad Problem</a>, Youtube video, 2020. %H A181715 Wikipedia, <a href="https://en.wikipedia.org/wiki/Cunningham_chain">Cunningham chain</a> %F A181715 a(n) < prime(n) for n > 1; see Löh (1989), p. 751. - _Jonathan Sondow_, Oct 28 2015 %F A181715 max(a(n), A181697(n)) = A263879(n) for n > 2. - _Jonathan Sondow_, Oct 30 2015 %F A181715 a(n) = A285700(A000040(n)). - _Antti Karttunen_, Apr 26 2017 %e A181715 2 -> 3 -> 5 -> 9 = 3^2, so a(1) = 3 and a(2) = 2. - _Jonathan Sondow_, Oct 30 2015 %p A181715 a := proc(n) %p A181715 local c, l: %p A181715 c, l := 0, ithprime(n): %p A181715 while isprime(l) do c, l := c+1, 2*l-1: od: %p A181715 c: %p A181715 end: # _Lorenzo Sauras Altuzarra_, Feb 12 2021 %t A181715 Table[p = Prime[n]; cnt = 1; While[p = 2*p - 1; PrimeQ[p], cnt++]; cnt, {n, 100}] (* _T. D. Noe_, Jul 12 2012 *) %t A181715 Table[-1 + Length@ NestWhileList[2 # - 1 &, Prime@ n, PrimeQ@ # &], {n, 98}] (* _Michael De Vlieger_, Apr 26 2017 *) %o A181715 (PARI) a(n)= n=prime(n); for(c=1,1e9, is/*pseudo*/prime(n=2*n-1) || return(c)) %Y A181715 Cf. A000040, A005382, A005408, A005602, A005603, A181697, A263879, A285700, A285706, A057326, A057327, A057328, A057329, A057330, A064812. %Y A181715 Cf. A137288 (positions of terms > 1). %K A181715 nonn %O A181715 1,1 %A A181715 _M. F. Hasler_, Nov 17 2010 %E A181715 Escape clause added to definition by _N. J. A. Sloane_, Feb 19 2021 %E A181715 Escape clause deleted from definition by _Jianing Song_, Nov 24 2021