According to WP article on Hall algebras one counts the number of abelian subgroups in abelian group with fixed type of subgroup, group, quotient.

Two things are claimed:

1) These numbers are polynomials in "p"

2) Using these numbers one naturally defines the algebra structure on the isomorphism classes of abelian groups which appears to be associative and commutative.

**Question:** What happens if we consider all p-groups, not just abelian one ? Will same/similar claims be true ?

PS

The natural context for the question seems to me some categories with finite number of exact triples A->B->C for fixed A,B,C. So natural generalization - what the properties of the categories for which we can define associative algebra ? commutative algebra ?