%I #60 Jun 29 2023 08:30:27
%S 1,1,1,2,2,1,1,3,6,6,3,1,1,4,11,16,16,11,4,1,1,5,17,33,48,48,33,17,5,
%T 1,1,6,24,58,107,140,140,107,58,24,6,1,1,7,32,92,203,329,424,424,329,
%U 203,92,32,7,1,1,8,41,136,347,668,1039,1280,1280,1039,668,347,136,41,8,1
%N Triangle read by rows: T(n,k) is the k-th Lie-Betti number of the path graph on n-vertices, n >= 1, 0 <= k <= 2*n - 1.
%H Marco Aldi and Samuel Bevins, <a href="https://arxiv.org/abs/2212.13608">L_oo-algebras and hypergraphs</a>, arXiv:2212.13608 [math.CO], 2022. See page 9.
%H Meera Mainkar, <a href="https://arxiv.org/abs/1310.3414">Graphs and two step nilpotent Lie algebras</a>, arXiv:1310.3414 [math.DG], 2013. See page 1.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PathGraph.html">Path Graph</a>.
%e Triangle begins:
%e k=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
%e n=1: 1 1
%e n=2: 1 2 2 1
%e n=3: 1 3 6 6 3 1
%e n=4: 1 4 11 16 16 11 4 1
%e n=5: 1 5 17 33 48 48 33 17 5 1
%e n=6: 1 6 24 58 107 140 140 107 58 24 6 1
%e n=7: 1 7 32 92 203 329 424 424 329 203 92 32 7 1
%e n=8: 1 8 41 136 347 668 1039 1280 1280 1039 668 347 136 41 8 1
%o (SageMath)
%o from sage.algebras.lie_algebras.lie_algebra import LieAlgebra
%o def LieAlgebraFromGraph(G, Module = QQ):
%o ''' Takes a graph and a module (optional) as an input.'''
%o d = {}
%o for edge in G.edges(): # this defines the relations among the generators of the Lie algebra
%o key = ("x" + str(edge[0]), "x" + str(edge[1])) #[x_i, x_j]
%o value = {"x_" + str(edge[0]) + "_" + str(edge[1]): 1} #x_{i,j}
%o d[key] = value #appending to the dictionary d
%o C = LieAlgebras(Module).WithBasis().Graded() #defines the category that we need to work with.
%o C = C.FiniteDimensional().Stratified().Nilpotent() #specifies that the algebras we want should be finite, stratified, and nilpotent
%o L = LieAlgebra(Module, d, nilpotent=True, category=C)
%o def sort_generators_by_grading(lie_algebra, grading_operator): #this sorts the generators by their grading. In this case, V1 are vertices and V2
%o generators = lie_algebra.gens()
%o grading = [grading_operator(g) for g in generators] #using the grading operator to split the elements into their respective vector spaces
%o sorted_generators = [g for _, g in sorted(zip(grading, generators))]
%o grouped_generators = {}
%o for g in sorted_generators:
%o if grading_operator(g) in grouped_generators:
%o grouped_generators[grading_operator(g)].append(g)
%o else:
%o grouped_generators[grading_operator(g)] = [g]
%o return grouped_generators
%o grading_operator = lambda g: g.degree() #defining the grading operator
%o grouped_generators = sort_generators_by_grading(L, grading_operator) #evaluating the function to pull the generators apart
%o V1 = grouped_generators[1] #elements from vertices
%o V2 = grouped_generators[2] #elements from edges
%o return L #, V1, V2 #returns the Lie algebra and the two vector spaces
%o def betti_numbers(lie_algebra): #this function will calculate the Lie theoretic Betti numbers and return them as a list
%o dims = []
%o H = lie_algebra.cohomology()
%o for n in range(lie_algebra.dimension() + 1):
%o dims.append(H[n].dimension())
%o return dims
%o def A360571_row(n):
%o if n == 1: return [1, 1]
%o return betti_numbers(LieAlgebraFromGraph(graphs.PathGraph(n)))
%o for n in range(1,7): print(A360571_row(n))
%Y Cf. A360572 (cycle graph), A088459 (star graph), A360625 (complete graph), A360938 (ladder graph), A360937 (wheel graph).
%Y Cf. A063782 appears to be half the row sum.
%K nonn,tabf
%O 1,4
%A _Samuel J. Bevins_, Feb 12 2023