login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I

%S 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,

%T 133,95,22,12,25,48,89,163,30,65,43,16,28,53,101,190,27,57,122,79,20,

%U 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

%N 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).

%C 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).

%C This differs from the "optimal" version A207831.

%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]

%e 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):

%e 1 2 4

%e . 3 6

%e . . 9

%e 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).

%e 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.

%o (PARI) /* assuming that the vector A207827 with the first line of the triangle has already been computed */

%o {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] ))))}

%o for(j=1,#T, for(i=1,j, print1(T[i,j]",")))

%K nonn,tabl

%O 1,2

%A _Eric Angelini_ and _M. F. Hasler_, Feb 20 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 26 22:49 EDT 2021. Contains 346300 sequences. (Running on oeis4.)