The OEIS is supported by the many generous donors to the OEIS Foundation.


(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A347608 Number of interlacing triangles of size n. 1


%S 1,2,20,1744,2002568,42263042752,21686691099024768,

%T 344069541824691045987328,226788686879114461294165127878656

%N Number of interlacing triangles of size n.

%C An interlacing triangle of size n is a triangular array of the numbers 1, 2, ..., (n+1)*n/2 such that if T(i,j) denotes the j-th number in the i-th row then either T(i-1,j+1) < T(i,j) < T(i-1,j) or T(i-1,j) < T(i,j) < T(i-1,j+1) for 1 < i <= n and 1 <= j <= n-i+1.

%C Generalizes A003121 for the case when rows are not strictly increasing. See comment from Mar 25 2012 and comment from Dec 02 2014.

%H James B. Sidoli, <a href="/A347608/a347608_2.pdf">On the number of interlacing triangles of size n</a>

%e For n = 2, a(2) = 2. The interlacing triangles are given below:

%e 2 2

%e 1 3 and 3 1.

%o (Sage)

%o def interlacing(n):

%o C_2=[]

%o part=[j for j in range(n-1,-1,-1)]

%o box=[]

%o big_box=[]

%o pos=0

%o d=0

%o C_2_star=[]

%o for g in Words([0,1],n*(n-1)/2).list():

%o C_2.append(list(g))

%o for h in C_2:

%o relations=[]

%o pos=0

%o big_box=[]

%o for j in range(len(part)-1):

%o for k in list(h)[pos:pos+part[j]]:

%o box.append(k)

%o big_box.append(box)

%o box=[]

%o pos=pos+part[j]

%o x=0

%o for k in range(1,len(big_box)):

%o for r in range(len(big_box[k])):

%o if big_box[k][r]==1 and big_box[k-1][r]==0 and big_box[k-1][r+1]==0 or big_box[k][r]==0 and big_box[k-1][r]==1 and big_box[k-1][r+1]==1:

%o continue

%o else:

%o x=x+1

%o if x==(n-1)*(n-2)/2:

%o q=q+1

%o C_2_star.append(big_box)

%o position=range(n*(n+1)/2)

%o for tri in C_2_star:

%o P=[]

%o relations=[]

%o counter=0

%o collect=[]

%o for j in range(len(tri)):

%o for r in range(len(tri[j])):

%o if tri[j][r]==0:

%o relations.append([position[counter],position[counter+n-j]])

%o relations.append([position[counter+n-j],position[counter+1]])

%o if tri[j][r]==1:

%o relations.append([position[counter+n-j],position[counter]])

%o relations.append([position[counter+1],position[counter+n-j]])

%o counter=counter+1

%o counter=counter+1

%o P=Poset([range(n*(n+1)/2),relations])

%o d=d+P.linear_extensions().cardinality()

%o return d

%Y Cf. A003121.

%K nonn,more

%O 1,2

%A _James B. Sidoli_, Sep 08 2021

%E a(7)-a(9) from _Dylan Nelson_, May 09 2022

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 25 16:14 EDT 2022. Contains 354071 sequences. (Running on oeis4.)