OFFSET
1,2
COMMENTS
This "second version" is obtained by discarding a candidate for T[1,k] when the column cannot be filled in the "greedy way", without exploring all possibilities by tracing back earlier choices of |a-b| vs a+b, when one "gets stuck" somewhere down in the column (i.e., the sum as well as the absolute difference already occurred).
This differs from the "optimal" version A207831.
LINKS
E. Angelini, Tableau avec soustractions/additions, Feb 19 2012
E. Angelini, Tableau avec soustractions/additions [Cached copy, with permission]
EXAMPLE
Start filling the columns of the triangle with 1, 2, 3=1+2 (because 2-1 already used), 4, 6=2+4 (because 4-2 already used), and 9=3+6 (because 6-3 already used):
1 2 4
. 3 6
. . 9
Then try T[1,4]=5, but this is not possible, since T[2,4] cannot be 4+5 nor 5-4 (both used). So try T[1,4]=7 (since 6 already used), which will allow us to fill the whole column (with 7+4=11 (since 7-4 already used), 11-6=5, 9+5=14 (since 9-5=4 already used).
PROG
(PARI) /* assuming that the vector A207827 with the first line of the triangle has already been computed */
{T=matrix( #A=A207827, #A); u=Set(T[1, ]=A); for(j=2, #T, for(i=2, j, setsearch( u, T[i, j]=abs(T[i-1, j-1]-T[i-1, j])) & T[i, j]=T[i-1, j-1]+T[i-1, j]; u=setunion( u, Set( T[i, j] ))))}
for(j=1, #T, for(i=1, j, print1(T[i, j]", ")))
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Eric Angelini and M. F. Hasler, Feb 20 2012
STATUS
approved