# Maple program for A203069 from njas, Aug 16 2021 # A[i] = 0 if i not yet in sequence, otherwise 1 # ans = A203069 # sss = sequences of pairiwise sums of terms # L = last term found # p = parity, 0 or 1, of next term # sm[p] = smallest missing number of parity p # M (< 100000) = number of terms wanted M1:=200000; A:=Array(1..M1,0, datatype=integer[1]); M:=1000; A[1]:=1; ans:=[1]; sss:=[1]; L:=1; p:=1; sm[0]:=2; sm[1]:=3; for n from 2 to M do p:=1-p; sw:=-1; for i from sm[p] by 2 to M1 do s:=L+i; if A[i]=0 and not isprime(s) then L:=i; ans:=[op(ans),L]; sss:=[op(sss),s]; A[L]:=1; sw:=1; # update smallest missing number? if L=sm[p] then sw2:=-1; for j from sm[p]+2 by 2 to M1 do if A[j]=0 then sm[p] := j; sw2:=1; break; fi; od: # od j if sw2=-1 then lprint("sm update failed at",n,i); break; fi; fi: break; fi; od: # od i if sw=-1 then lprint("failed at n =",n); break; fi; od: # od n ans; # A203069 sss; # A346609