OFFSET
1,1
COMMENTS
MAPLE
N:= 1000: # to get a(1) to a(m-1) where a(m) is the first term > N
a[1]:= 3:
R:= {$1..N} minus {3}:
P:= 3:
S:= 3:
success:= true:
for n from 2 while success and R <> {} do
success := false;
for r in R do
if type((P*r)/(S+r), integer) then
a[n]:= r;
nmax:= n;
R:= R minus {r};
success:= true;
P:= P * r;
S:= S + r;
break
fi
od:
od:
seq(a[i], i=1..nmax); # Robert Israel, Dec 13 2014
MATHEMATICA
f[l_List] := Block[{k = 1, s = Plus @@ l, p = Times @@ l}, While[MemberQ[l, k] || Mod[k*p, k + s] > 0, k++ ]; Append[l, k]]; Nest[f, {3}, 75] (* Ray Chandler, Jan 22 2007 *)
PROG
(PARI) v=[3]; print1(3, ", "); n=1; while(n<100, p=prod(i=1, #v, v[i]); if(p*n\(vecsum(v)+n)==p*n/(vecsum(v)+n)&&!vecsearch(vecsort(v), n), v=concat(v, n); print1(n, ", "); n=0); n++) \\ Derek Orr, Dec 13 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 22 2007
EXTENSIONS
Extended by Ray Chandler, Jan 22 2007
STATUS
approved