import numberdb.sage as numberdb
from sage.arith.misc import binomial
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
T = PolynomialRing(QQ, "t")
t = T.gen()
def ehrhart_from_h_star(coefficients, dimension):
return sum(QQ(c) * T(binomial(t + dimension - i, dimension))
for i, c in enumerate(coefficients))
ehrhart_from_h_star([1, 14, 87, 148, 87, 14, 1], 9) # H_4(t)The $h^*$-coefficients used to compute these rows are transcribed from OEIS A259473 [5], and the Ehrhart polynomials are obtained from them by the binomial transform in (2).