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 A063377 #30 Oct 30 2022 18:19:59 %S A063377 0,5,2,0,4,0,1,0,0,0,3,0,1,0,0,0,1,0,1,0,0,0,2,0,0,0,0,0,2,0,1,0,0,0, %T A063377 0,0,1,0,0,0,3,0,1,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0, %U A063377 0,0,1,0,1,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,6,0,0,0,0,0,0,0,1,0,0,0 %N A063377 Sophie Germain degree of n: number of iterations of n under f(k) = 2k+1 before we reach a number that is not a prime. %C A063377 a(n) >= 1 means that n is prime; a(n) >= 2 means that n is a Sophie Germain prime. Is the Sophie Germain degree always finite? Is it unbounded? %C A063377 A339579 is an essentially identical sequence from 1981. - _N. J. A. Sloane_, Dec 24 2020 %C A063377 From _Michael S. Branicky_, Dec 24 2020: (Start) %C A063377 All n > 5 with a(n) >= 4 satisfy n == 9 (mod 10). %C A063377 Proof. Let f^k(n) denote iterates of 2*k + 1, with f^0(n) = n. %C A063377 n != 0, 2, 4, 5, 6, or 8 (mod 10), otherwise f^0(n) is not prime, and a(n) = 0. %C A063377 n != 7 (mod 10) otherwise f^1(n) = 2*n + 1 == 5 (mod 10), not prime, and a(n) <= 1. %C A063377 n != 3 (mod 10) otherwise f^2(n) = 4*r + 3 == 5 (mod 10), not prime, and a(n) <= 2. %C A063377 n != 1 (mod 10) otherwise f^3(n) = 8*r + 7 == 5 (mod 10), not prime, and a(n) <= 3. %C A063377 (End) %C A063377 From _Peter Schorn_, Jan 18 2021: (Start) %C A063377 The Sophie Germain degree is always finite. %C A063377 Proof. Let f^k(n) denote iterates of 2*k + 1 with closed form f^k(n) = 2^k * n + 2^k - 1. %C A063377 There are three cases for n: %C A063377 1. If n is not a prime then f^0(n) = n is composite. %C A063377 2. If n = 2 then f^5(2) = 95 is composite. %C A063377 3. If n is an odd prime then f^(n-1)(n) = 2^(n-1) * n + 2^(n-1) - 1 is divisible by n since 2^(n-1) == 1 (mod n) by Fermat's theorem. %C A063377 (End) %H A063377 Antti Karttunen, <a href="/A063377/b063377.txt">Table of n, a(n) for n = 1..20000</a> %H A063377 Antti Karttunen, <a href="/A063377/a063377.txt">Data supplement: n, a(n) computed for n = 1..100000</a> %F A063377 From _Michael S. Branicky_, Dec 24 2020: (Start) %F A063377 See proof above. %F A063377 a(n) = 0 if n == 0, 2, 4, 5, 6, 8 (mod 10), and n != 2 or 5. %F A063377 a(n) <= 1 if n == 7 (mod 10). %F A063377 a(n) <= 2 if n == 3 (mod 10). %F A063377 a(n) <= 3 if n == 1 (mod 10). %F A063377 (End) %e A063377 a(2)=5 because 2, 5, 11, 23, 47 are prime but 95 is not. %t A063377 Table[Length[NestWhileList[2#+1&,n,PrimeQ[#]&]],{n,100}]-1 (* _Harvey P. Dale_, Aug 08 2020 *) %o A063377 (PARI) a(n) = {if (! isprime(n), return (0)); d = 1; k = n; while(isprime(p = 2*k+1), k = p; d++;); return (d);} \\ _Michel Marcus_, Jul 22 2013 %Y A063377 Cf. A005384, A063378, A093008, A093007, A292936, A339579. %Y A063377 For records see A339581. %Y A063377 See also Cunningham chains, A005602, A005603. %K A063377 nonn %O A063377 1,2 %A A063377 _Reiner Martin_, Jul 14 2001 %E A063377 Term a(1) = 0 prepended by _Antti Karttunen_, Oct 09 2018.