cp's OEIS Frontend

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.

A074973 Smallest index i such that next_prime( 2*prime(i) ) - 2*prime(i) = 2n - 1.

This page as a plain text file.
%I A074973 #18 May 04 2025 02:04:57
%S A074973 1,4,11,20,17,67,104,56,125,165,182,316,236,359,407,1254,667,836,1521,
%T A074973 1210,1966,3197,1520,2294,2279,2046,5410,5472,1965,6702,13947,10138,
%U A074973 12122,16760,7659,22325,16784,13072,36169,17852,15414,69872,23814,16370,46752
%N A074973 Smallest index i such that next_prime( 2*prime(i) ) - 2*prime(i) = 2n - 1.
%C A074973 First index i such that NextPrime[p2=2*Prime[i]]-p2 is 2n-1; case n=1 corresponds to Sophie Germain (SG) primes, others may be called SG n-primes. Distance between 2*(n-th prime) and next prime in A059787.
%H A074973 Robert Israel, <a href="/A074973/b074973.txt">Table of n, a(n) for n = 1..171</a>
%e A074973 a(54) = 342337 because difference between 2*p(342337) and next prime is 2*54 -1 = 107 and 342337 is the smallest such index.
%p A074973 N:= 60: # for a(1) .. a(N)
%p A074973 V:= Vector(N): count:= 0:
%p A074973 p:= 1:
%p A074973 for i from 1 while count < N do
%p A074973   p:= nextprime(p);
%p A074973   v:= (nextprime(2*p)-2*p+1)/2;
%p A074973   if v <= N and V[v] = 0 then V[v]:= i; count:= count+1;  fi;
%p A074973 od:
%p A074973 convert(V,list); # _Robert Israel_, May 03 2025
%o A074973 (PARI) a(n) = {i = 1; while (nextprime(p2=2*prime(i)) - p2 != 2*n-1, i++); i;} \\ _Michel Marcus_, Oct 03 2013
%o A074973 (Magma)
%o A074973 S:=[];
%o A074973 i:=1;
%o A074973 for n in [1..45] do
%o A074973    while not NextPrime(2*NthPrime(i))-2*NthPrime(i) eq 2*n-1 do
%o A074973         i:=i+1;
%o A074973    end while;
%o A074973    Append(~S, i);
%o A074973    i:=1;
%o A074973 end for;
%o A074973 S;  // _Bruno Berselli_, Oct 03 2013
%Y A074973 Cf. A059787.
%K A074973 nonn
%O A074973 1,2
%A A074973 _Zak Seidov_, Oct 06 2002
%E A074973 a(44)-a(45) from _Bruno Berselli_, Oct 03 2013