%I #4 Dec 05 2013 19:55:32
%N a(1) =2. Let S(k) = sum of k terms. If S(n) is prime then a(n+1) is the smallest prime not included earlier else a(n+1) is the smallest composite number not included earlier.
%A _Amarnath Murthy_, Aug 17 2002
%E Corrected and extended by _Sean A. Irvine_, Nov 29 2009