login
a(n) = least prime of the form prime(n+1) + k*prime(n).
0

%I #5 Jan 23 2016 16:50:48

%S 5,11,17,53,79,43,53,61,167,89,223,263,617,563,241,271,179,311,607,

%T 499,809,241,421,631,683,709,313,751,331,353,2417,661,1783,983,449,

%U 761,1733,1471,3847,1217,1613,1277,1721,1741,593,3793,1489,673,683,691,1171,719

%N a(n) = least prime of the form prime(n+1) + k*prime(n).

%e For n = 3 we have prime(n+1) = 7, prime(n) = 5; 17 is the least prime of form 7 + k*5, so a(3) =17.

%t lpf[n_]:=Module[{k=1,np=NextPrime[n]},While[!PrimeQ[k*n+np],k++];k*n+np]; lpf/@Prime[Range[60]] (* _Harvey P. Dale_, Jan 23 2016 *)

%o (PARI) {m=250;q=2;p=3;while(p<m,k=1;while(!isprime(a=p+k*q),k++);print1(a,",");q=p;p=nextprime(p+1))}

%K nonn

%O 1,1

%A _Amarnath Murthy_, Jun 02 2004

%E Edited and extended by _Klaus Brockhaus_, Jun 03 2004