%I
%S 1,2,4,7,8,10,13,12,16,20,19,32,24,34,29,40,31,45,52,42,62,81,46,47,
%T 91,68,111,70,84,99,61,113,80,78,125,85,141,105,102,130,55,106,142,
%U 168,98,188,135,120,189,150,157,295,171,195,178,254,164,216,212,144
%N First line of the upper right triangle A207826: Least T[1,n]>0 such that the nth column can be filled with T[k+1,n] = T[k,n1]T[k,n] or T[k,n1]+T[k,n] if the former was used earlier.
%C This version differs from the first version A207829, where all possibilities of x+y vs xy are tested in a given column, before discarding a candidate for the next element of the first line. Here a candidate a(n)=T[1,n] is discarded when successive ("greedy") choices of smallest possible elements T[k,n] (k=2, 3,...) lead (in some subsequent row k) to a situation where no choice is possible, i.e., both T[k,n1]T[k,n] and T[k,n1]+T[k,n] appear earlier.
%H E. Angelini, <a href="http://www.cetteadressecomportecinquantesignes.com/ArrayDiffOrAdd.htm">Tableau avec soustractions/additions</a>, Feb 19 2012
%H E. Angelini, <a href="/A207826/a207826.pdf">Tableau avec soustractions/additions</a> [Cached copy, with permission]
%o (PARI) list_A207827(Nmax,show=1/*print out terms as they are calculated*/)={ my( u=[], lc=u, f(a,b,u) = setsearch( u, abs(ab))  return(abs(ab)); !setsearch( u, a+b ) & return(a+b)); vector( Nmax, n, my(nc=vector(n)); until( nc[n], while( setsearch( u, nc[1]++),); for( k=2,n, (nc[k] = f( nc[k1], lc[k1], setunion( Set( vecextract( nc,2^(k1)1 )), u )))  next(2))); u=setunion(u,Set(lc=nc)); show & print1(nc[1]","); nc[1])}
%K nonn
%O 1,2
%A _M. F. Hasler_, Feb 20 2012
