OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 1000: # for terms before the first term > N
Avail:= [$2..N]:
A[1]:= 1: T:= 1:
for n from 2 while assigned(A[n-1]) do
for j from 1 to N+1-n do
x:= Avail[j];
if (n::even and isprime(x+T) and not isprime(x)) or
(n::odd and isprime(x) and not isprime(x+T)) then
A[n]:= x; T:= T+x;
Avail:= subsop(j=NULL, Avail);
break
fi
od
od:
seq(A[i], i=1..n-2); # Robert Israel, Nov 26 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler Feb 16 2005
EXTENSIONS
Definition corrected by Zak Seidov, Feb 20 2005
STATUS
approved