login
A207826
Upper right triangle: Fill columns with the smallest possible positive integers not occurring earlier and such that T[n+1,k] = |T[n,k-1]-T[n,k]| or T[n,k-1]+T[n,k]. Second version (see comment).
4
1, 2, 3, 4, 6, 9, 7, 11, 5, 14, 8, 15, 26, 21, 35, 10, 18, 33, 59, 38, 73, 13, 23, 41, 74, 133, 95, 22, 12, 25, 48, 89, 163, 30, 65, 43, 16, 28, 53, 101, 190, 27, 57, 122, 79, 20, 36, 64, 117, 218, 408, 381, 324, 202, 123, 19, 39, 75, 139, 256, 474, 66, 315, 639, 437, 314, 32, 51, 90, 165, 304, 560, 86, 152, 467, 172, 265, 49, 24, 56, 107, 17
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).
See the Example in A207831 for the difference (occurring in the 25th column) with that triangle: since the greedy way of filling the column would not work with T[1,25]=A207829(25)=83, we have T[1,25]=A207827(25)=91 here.
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
Sequence in context: A306441 A370981 A207831 * A035312 A056230 A285321
KEYWORD
nonn,tabl
AUTHOR
Eric Angelini and M. F. Hasler, Feb 20 2012
STATUS
approved