PoincareSeries(G,n):: Group, Int --> RationalFunction
PoincareSeries(G):: Group --> RationalFunction
PoincareSeries(R,n):: Group, Int --> RationalFunction
PoincareSeries(L,n):: Group, Int --> RationalFunction

Inputs a finite p-group G and a positive integer n. It returns a quotient of polynomials f(x)=P(x)/Q(x) whose expansion has coefficient of x^k equal to the rank of the vector space H_k(G,\mathbb F_p) for all k in the range 1 \le k \le n. (The second input variable can be omitted, in which case the function tries to choose a `reasonable' value for n. For 2-groups the function PoincareSeriesLHS(G) can be used to produce an f(x) that is correct in all degrees.)

In place of the group G the function can also input (at least n terms of) a minimal mod-p resolution R for G.

Alternatively, the first input variable can be a list L of integers. In this case the coefficient of x^k in f(x) is equal to the (k+1)st term in the list.