login
a(1) = 3 and a(n+1) is the least prime greater than a(n) + 2n such that a(n+1) + 2n + 2 is prime.
1

%I #21 Sep 14 2017 09:35:56

%S 3,7,13,23,37,59,83,151,173,251,331,359,431,463,541,587,643,683,773,

%T 823,877,947,1051,1103,1163,1231,1307,1367,1429,1489,1559,1657,1723,

%U 1811,1933,2011,2087,2221,2311,2393,2539,2647,2801,2953,3079,3209

%N a(1) = 3 and a(n+1) is the least prime greater than a(n) + 2n such that a(n+1) + 2n + 2 is prime.

%C a(n) > n^2 + n, so the sum of the reciprocals of the terms of this sequence converges: 1/3 + 1/7 + 1/13 + 1/23 + 1/37 + ... = 0.720731....

%H Charles R Greathouse IV, <a href="/A291141/b291141.txt">Table of n, a(n) for n = 1..10000</a>

%o (PARI) {

%o p=2;

%o forstep(n=2,100,2,

%o p=nextprime(p+1);

%o while(!isprime(p+n),p=nextprime(p+1));

%o print1(p", ");p=p+n;

%o )

%o }

%o (PARI) first(n)=my(v=vector(n)); v[1]=3; for(k=2,n, forprime(p=v[k-1]+2*k,, if(isprime(p+2*k), v[k]=p; break))); v \\ _Charles R Greathouse IV_, Sep 13 2017

%K nonn

%O 1,1

%A _Dimitris Valianatos_, Aug 18 2017