OFFSET
3,5
COMMENTS
A graceful Prüfer code of length n-2 is a sequence over {0,1,...,n-1} corresponding to a gracefully labeled tree on n vertices. Each such code belongs to an involution pair obtained by applying the natural involution induced by relabeling the underlying tree. The lexicographic rank of a Prüfer code is taken among all n^(n-2) sequences of length n-2 over {0,1,...,n-1}, ordered lexicographically. Let H = n^(n-2)/2. This sequence counts involution pairs (c,c') such that rank(c) < H and rank(c') < H. In other words, each counted pair is lying entirely in the first half of the space of codes.
REFERENCES
Douglas B. West, Introduction to Graph Theory, Pearson Education, 2002, page 81.
LINKS
Igor Blokhin, Graceful Prüfer Codes (Python repository).
EXAMPLE
The first involution pair of graceful Prüfer codes lying entirely in the first half appears for a tree with 6 vertices. It corresponds to two graceful labelings of a path: 3-5-0-4-1-2 (Prüfer code: 1,4,5,0) and 2-0-5-1-4-3 (Prüfer code: 0,5,4,1). These two codes form an involution pair obtained by exchanging the roles of the vertices using the formula f(v)=n-1-v.
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Igor Blokhin, Feb 03 2026
STATUS
approved
