#Tn(n): all binary trees with n nodes Tn:=proc(n) local gu,i,T1,T2,gu1,gu2: if n=1 then RETURN({[]}): fi: gu:={}: for i from 1 to n-1 do gu1:=Tn(i): gu2:=Tn(n-i): gu:=gu union {seq(seq([T1,T2],T1 in gu1),T2 in gu2)}: od: gu: end: #NuL(T): the number of leaves of the binary tree T NuL:=proc(T) if T=[] then 1: else NuL(T[1])+NuL(T[2]): fi: end: #Imas1(T): all the images of the tree T under the Conway-Guy mapping [[A,B],[C,D]]->[[A,C],[B,D]] Imas1:=proc(T) local T1,T2,gu1,gu2,T1a,T2a,gu11,gu12,gu21,gu22,T11a,T12a,T21a,T22a,gu,T11,T12,T21,T22: if NuL(T)<=4 then RETURN({T}): fi: T1:=T[1]: T2:=T[2]: gu1:=Imas1(T1): gu2:=Imas1(T2): gu:={seq(seq([T1a,T2a],T1a in gu1),T2a in gu2)}: if NuL(T1)>=2 and NuL(T2)>=2 then T11:=T1[1]: T12:=T1[2]: T21:=T2[1]: T22:=T2[2]: gu11:=Imas1(T11): gu12:=Imas1(T12): gu21:=Imas1(T21): gu22:=Imas1(T22): gu:=gu union {seq(seq(seq( seq( [[T11a,T21a], [T12a,T22a]], T11a in gu11),T12a in gu12),T21a in gu21), T22a in gu22)}: fi: gu: end: #Imas1Set(S): all the images of the members of S Imas1Set:=proc(S) local T: {seq(op(Imas1(T)), T in S)}: end: #Imas(T): The transitive closure of T under the equivalence relation Imas:=proc(T) local gu,gu1,gu2: gu:={T}: gu1:=Imas1Set(gu): while gu<>gu1 do gu2:=Imas1Set(gu1): gu:=gu1: gu1:=gu2: od: gu1: end: #Reps(n): a set of representatives of of A2844 Reps:=proc(n) local gu,mu,gu1: gu:=Tn(n): mu:={}: while gu<>{} do gu1:=gu[1]: mu:=mu union {gu1}: gu:=gu minus Imas(gu1): od: mu: end: A2844:=proc(N) local n: [seq(nops(Reps(n)),n=1..N)]: end: