Partition Functions and Kurepa Decomposition I: Algebraic computation and some physical Applications | Synapse