OFFSET
1,1
COMMENTS
Is this a permutation of the natural numbers? - Derek Orr, Feb 07 2015
EXAMPLE
a(3) = 3 because 3 is the smallest number not already used such that the sum of all 3 terms (4 + 2 + 3 = 9) is semiprime.
MAPLE
N:= 1000: # get all terms before the first term > N
S:= {$1..N} minus {4}:
T:= 4: A[1]:= 4:
for n from 2 do
found:= false;
for s in S do
if numtheory:-bigomega(s+T) = 2 then
A[n]:= s;
S:= S minus {s};
T:= s + T;
found:= true;
break
fi
od:
if not found then break fi;
od:
seq(A[i], i=1..n-1); # Robert Israel, Mar 24 2015
MATHEMATICA
f[n_] := Block[{k, s = Select[Range[2(n^2 + n)/3], PrimeOmega@ # == 2 &], t = Table[4, {n}]}, For[k = 2, k <= n, k++, t[[k]] = Min@ Select[s - Total[Take[t, k - 1]], # > 0 && ! MemberQ[t, #] &]]; t]; f@ 75 (* Michael De Vlieger, Mar 24 2015 *)
PROG
(PARI) v=[4]; n=1; while(n<100, if(bigomega(vecsum(v)+n)==2&&!vecsearch(vecsort(v), n), v=concat(v, n); n=0); n++); v \\ Derek Orr, Feb 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
G. L. Honaker, Jr., Jan 23 2015
STATUS
approved