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 A181697 #33 Nov 24 2021 09:02:58 %S A181697 5,2,4,1,3,1,1,1,2,2,1,1,3,1,1,2,1,1,1,1,1,1,2,6,1,1,1,1,1,2,1,2,1,1, %T A181697 1,1,1,1,1,2,5,1,2,1,1,1,1,1,1,1,2,2,1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1, %U A181697 1,1,1,4,1,1,1,1,1,1,1,1,2,1,2,1,1,2,1,1 %N A181697 Length of the complete Cunningham chain of the first kind starting with prime(n). %C A181697 Number of iterations x->2x+1 needed to get a composite number, when starting with prime(n). %C A181697 prime(n) is in A005384, i.e., a Sophie Germain prime, iff a(n)>1. %C A181697 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 A181697 T. D. Noe, <a href="/A181697/b181697.txt">Table of n, a(n) for n = 1..10000</a> %H A181697 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 A181697 Wikipedia, <a href="https://en.wikipedia.org/wiki/Cunningham_chain">Cunningham chain</a> %F A181697 a(n) < prime(n) for n > 1; see Löh (1989), p. 751. - _Jonathan Sondow_, Oct 28 2015 %F A181697 max(a(n), A181715(n)) = A263879(n) for n > 2. - _Jonathan Sondow_, Oct 30 2015 %e A181697 2 -> 5 -> 11 -> 23 -> 47 -> 95 = 5*19, so a(1) = 5, a(3) = 4, a(5) = 3, a(9) = 2, and a(15) = 1. - _Jonathan Sondow_, Oct 30 2015 %t A181697 Table[p = Prime[n]; cnt = 1; While[p = 2*p + 1; PrimeQ[p], cnt++]; cnt, {n, 100}] (* _T. D. Noe_, Jul 12 2012 *) %o A181697 (PARI) a(n)= n=prime(n); for(c=1,1e9, is/*pseudo*/prime(n=2*n+1) || return(c)) %Y A181697 Cf. A005602, A181715, A263879. %Y A181697 See also A075712, A338945. %K A181697 nonn %O A181697 1,1 %A A181697 _M. F. Hasler_, Nov 17 2010 %E A181697 Definition clarified by _Jonathan Sondow_, Oct 28 2015