(Python)
print("1, 1, ")
x=[1, 2]
maxx=50
final=[1, 2]
n=3
x.append(n)
oldLen=len(x)
while noldLen:
print (x[0], ", ", end="")
s=[]
p=[]
z=[]
for i in range(myLen-1):
for j in range(i+1, myLen):
s.append( x[i]+x[j] )
p.append( x[i]*x[j] )
z=list(zip( s, p ))
y=[]
y=sorted(z)
sumsort=[]
prodsort=[]
for h5 in range(len(y)):
vals, valp=y[h5]
sumsort.append(vals)
prodsort.append(valp)
errer=0
for j5 in range(len(sumsort)-1):
for k5 in range(j5+1, len(sumsort)):
if sumsort[k5]0:
break
if errer<1:
for ptr in range (len(y)-1):
if y[ptr]==y[ptr+1]:
errer=1
break
if errer>0:
final.append(-x[0])
x.pop(0)
else:
final.append(n)
n+=1
x.append(n)
oldLen=myLen
# _Bill McEachen_, Dec 09 2015