#John Kim #Use whatever you like #read "C:/Users/John Y. Kim/Documents/Maple/hw18Special.txt": Help:=proc(): print(`mex(S), a(n)`): end: #mex(S): inputs a set of non-negative integers and #outputs the smallest non-negative integer NOT in S. mex:=proc(S) local m,i: m:=max(S): for i from 0 to m do if not i in S then RETURN(i): fi: od: RETURN(m+1): end: a:=proc(n) local j,r: option remember: if n=1 then RETURN(2): fi: if n=2 then RETURN(3): fi: RETURN(mex({0,1} union {seq(seq(j*a(r),j=1..100), r=1..n-1)})): end: