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 A371981 #14 Jun 11 2024 10:03:50 %S A371981 0,0,1,3,0,2,2,6,0,5,1,7,0,1,7,0,1,5,1,9,8,1,2,7,2,10,7,2,0,3,3,3,2,4, %T A371981 15,5,7,0,1,2,8,14,0,7,13,4,1,3,4,0,5,3,1,17,9,9,0,2,3,5,4,1,0,7,2,14, %U A371981 7,2,6,0,6,7,0,18,0,6,1,7,9,3,2,0,5,28,5,3,3,2,1,5,6,7,3,15,2 %N A371981 Number of primes between two successive Sophie Germain primes, with Sophie Germain primes not themselves included in the count. %C A371981 Number of primes between A005384(n) and A005384(n+1). %F A371981 a(n) = A000720(A005384(n+1)) - A000720(A005384(n)) - 1. - _Michael De Vlieger_, Apr 19 2024 %e A371981 a(4) = 3 because there are 3 primes between 11 and 23: 13, 17 and 19. %t A371981 -1 + Subtract @@ Map[PrimePi, {Last[#], First[#]}] & /@ Partition[Select[Prime[Range[500]], PrimeQ[2 # + 1] &], 2, 1] (* _Michael De Vlieger_, Apr 19 2024 *) %o A371981 (Python) %o A371981 from sympy import isprime %o A371981 l = [] %o A371981 s = 0 %o A371981 for i in range(3,3800): %o A371981 if isprime(i): %o A371981 if isprime(2*i + 1): %o A371981 l.append(s) %o A371981 s = 0 %o A371981 else: %o A371981 s += 1 %o A371981 print(l) %o A371981 (PARI) lista(nn) = my(vp = select(p->isprime(2*p+1), primes(nn)), wp = apply(primepi, vp)); vector(#wp-1, k, wp[k+1]-wp[k]-1); \\ _Michel Marcus_, May 21 2024 %Y A371981 Cf. A000720, A005384. %K A371981 nonn %O A371981 1,4 %A A371981 _Alexandre Herrera_, Apr 15 2024