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!)
A207827 First line of the upper right triangle A207826: Least T[1,n]>0 such that the n-th column can be filled with T[k+1,n] = |T[k,n-1]-T[k,n]| or T[k,n-1]+T[k,n] if the former was used earlier. 2

%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 n-th column can be filled with T[k+1,n] = |T[k,n-1]-T[k,n]| or T[k,n-1]+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 |x-y| 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,n-1]-T[k,n]| and T[k,n-1]+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(a-b)) || return(abs(a-b)); !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[k-1], lc[k-1], setunion( Set( vecextract( nc,2^(k-1)-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

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 June 13 14:23 EDT 2021. Contains 345003 sequences. (Running on oeis4.)