Examples
Basic Examples (2)
Sum xt for t from 0 to infinity:
Sum rxsy for all integer lattice points satisfying x ⩾ 0, y ⩾ 0 and x +y ⩽ 5:
Count the number of integer lattice points satisfying x ⩾ 0, y ⩾ 0 and x + y ⩽ 5:
Compute the number directly:
Scope (3)
Compute the sum of xaybzc over non-negative integers satisfying x + y + z ⩽ 5:
Count the total number of non-negative lattice points satisfying x + y + z ⩽ 5:
Visualize these lattice points. Here, we use FindInstance to obtain all the points:
A complicated example, the algorithm gets the result instantly:
Properties & Relations (2)
LatticeSum[monomial, constraints] returns Indeterminate if the constraints are not bounded:
Here z+w is treated as a base of the monomial:
Possible Issues (3)
The first input should be a monomial:
Constraint variables cannot be the same as the base variables of the monomial:
All constraints should be linear and have integer or rational coefficients:
Publisher
Xiangdong Wen
Related Links
Requirements
Wolfram Language 13.0
(December 2021) or above
Version History
-
1.0.1
– 13 April 2026
-
1.0.0
– 11 March 2026
Related Resources
Author Notes
It supports only linear constraints.