login
a(0)=1, then a(n) is the least sum of two successive primes that is a multiple of n and > a(n-1).
1

%I #20 Jun 02 2016 12:29:15

%S 1,5,8,12,24,30,36,42,112,144,210,308,360,390,434,450,480,918,990,

%T 1064,1120,1428,1518,1656,1848,1900,2132,2430,2604,2610,2640,2728,

%U 2912,2970,2992,3010,3240,3330,3952,4056,4680,5740,6090,6450,6600,6660,6762,7990,8256,8428,9000,9282,9308

%N a(0)=1, then a(n) is the least sum of two successive primes that is a multiple of n and > a(n-1).

%H Robert Israel, <a href="/A260966/b260966.txt">Table of n, a(n) for n = 0..4628</a>

%e a(1)=5=2+3, a(2)=8=3+5, a(3)=12=5+7, a(4)=24=11+13, a(5)=30=13+17.

%p N:= 10^5: # get all terms using primes <= N

%p Primes:= select(isprime,[2,(2*i+1 $ i=1..floor((N-1)/2))]):

%p Sprimes:= Primes[1..-2] + Primes[2..-1]:

%p A[0]:= 1: x[0]:= 0: ok:= true:

%p for n from 1 while ok do

%p ok:= false;

%p for t from x[n-1]+1 to nops(Sprimes) do

%p if Sprimes[t] mod n = 0 then

%p A[n]:= Sprimes[t]; x[n]:= t; ok:= true; break

%p fi

%p od

%p od:

%p seq(A[i],i=0..n-2); # _Robert Israel_, Aug 06 2015

%t Prepend[Reap[n=1;Do[If[Mod[(a=Prime[k]+Prime[k+1]),n]<1,Sow[a];i++],{k,1000}]][[2,1]],1]

%t nxt[{n_,a_}]:=Module[{sprs=Total/@Partition[Prime[Range[1000]],2,1]},{n+1, SelectFirst[sprs,Divisible[#,n+1]&&#>a&]}]; Transpose[ NestList[ nxt,{0,1},60]][[2]] (* _Harvey P. Dale_, Jun 02 2016 *)

%Y Cf. A001043, A247245.

%K nonn

%O 0,2

%A _Zak Seidov_, Aug 06 2015