OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..4628
EXAMPLE
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.
MAPLE
N:= 10^5: # get all terms using primes <= N
Primes:= select(isprime, [2, (2*i+1 $ i=1..floor((N-1)/2))]):
Sprimes:= Primes[1..-2] + Primes[2..-1]:
A[0]:= 1: x[0]:= 0: ok:= true:
for n from 1 while ok do
ok:= false;
for t from x[n-1]+1 to nops(Sprimes) do
if Sprimes[t] mod n = 0 then
A[n]:= Sprimes[t]; x[n]:= t; ok:= true; break
fi
od
od:
seq(A[i], i=0..n-2); # Robert Israel, Aug 06 2015
MATHEMATICA
Prepend[Reap[n=1; Do[If[Mod[(a=Prime[k]+Prime[k+1]), n]<1, Sow[a]; i++], {k, 1000}]][[2, 1]], 1]
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 06 2015
STATUS
approved