OFFSET
1,1
COMMENTS
We start with the sequence of natural numbers A000027:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,...
Consider the first pair (1,2), it sums to prime, 3, hence a(1)=3, and we consider the next pair (3,4), again 3+4=7 is prime hence a(2)=7; and also, 5+6=11 is prime hence a(3)=11; now the next pair (7,8) sums to 15 which is not prime, hence a(4)=7, and next pair under consideration is (8,9) which gives a(5)=8+9=17; 10+11 is not pair hence a(6)=10; 11+12=23 is prime hence a(7)=23, etc.
In short, if the current pair sums to prime we take this sum as the next term of the sequence, otherwise the lesser member of pair is taken as the next term of the sequence.
MATHEMATICA
n=1; s=Reap[Do[If[PrimeQ[p=2n+1], b=p; n=n+2, b=n; n=n+1]; Sow[b], {20}]][[2, 1]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 04 2009
STATUS
approved