How this calculation works
An affine semigroup consists of all nonnegative integer combinations of finitely many integer vectors. Membership asks whether a target vector can be assembled from those generators. Counting asks how many coefficient vectors produce the same target. In two or three dimensions these constraints couple several resource totals at once. A one-dimensional numerical semigroup's gap list or Frobenius number does not answer that vector problem, and ordinary real linear feasibility would allow fractional coefficients that are forbidden here.
Count(t,i)=Σ_(k≥0) Count(t−k g_i,i+1).A worked example
The default generators are (2,0), (0,2) and (1,1), with target (4,4). If c is the coefficient of (1,1), both equations require c to be even. Choosing c=0, 2 or 4 gives coefficient vectors (2,2,0), (1,1,2) and (0,0,4). There are therefore three factorizations. The displayed witness is only one of those vectors; a successful membership result and a complete factorization count answer different questions about the same target.
Good to know
Nonzero nonnegative integer generators in 2–3 dimensions, up to 8 columns and target coordinates at most 60; finite dynamic programming, exact count and coefficient witnesses; target-specific, not a Hilbert basis claim.
Reference: Geroldinger and Zhong: factorization in affine monoids (opens in a new tab) ↗
What this calculation determines
An affine semigroup consists of all nonnegative integer combinations of finitely many integer vectors. Membership asks whether a target vector can be assembled from those generators.
Counting asks how many coefficient vectors produce the same target. In two or three dimensions these constraints couple several resource totals at once. A one-dimensional numerical semigroup's gap list or Frobenius number does not answer that vector problem, and ordinary real linear feasibility would allow fractional coefficients that are forbidden here.
Compare this with the Numerical semigroup Apery set genus and Frobenius calculator. Solve a nonnegative integer vector factorization problem in multiple dimensions, rather than list gaps in a one-dimensional numerical semigroup.
Enter the data in the stated convention
Enter one generator vector per row and a target vector of the same length. Coordinates must be nonnegative integers, and the zero generator is excluded because it would create infinitely many coefficient factorizations for every reachable target.
This version supports two or three coordinates. Duplicate generator vectors remain separately labeled, so using one copy or the other counts as a different coefficient vector. Remove duplicates first if your intended interpretation treats identical generator types as indistinguishable.
How the mathematics works
Dynamic programming considers generator types in their supplied order. At each stage it chooses how many copies of the current vector to use, subtracts that contribution from the remaining target and recurses on later types.
Memoization merges repeated subproblems. The maximum multiplicity is bounded by every positive coordinate of the current generator. Counts are arbitrary-precision integers, avoiding an incorrect rounded answer when the number of factorizations exceeds the safe integer range of ordinary floating-point arithmetic.
Work through the default example
The default generators are (2,0), (0,2) and (1,1), with target (4,4). If c is the coefficient of (1,1), both equations require c to be even.
Choosing c=0, 2 or 4 gives coefficient vectors (2,2,0), (1,1,2) and (0,0,4). There are therefore three factorizations. The displayed witness is only one of those vectors; a successful membership result and a complete factorization count answer different questions about the same target.
Read the returned certificate
A count of zero means the target is outside the generated semigroup within this exact nonnegative-integer model. It does not mean the target lies outside the real cone spanned by the generators.
For example, parity restrictions can exclude an integer point that has a perfectly valid real convex-cone representation. The witness lists coefficients in generator order. Multiplying each coefficient by its generator and adding coordinatewise should recover the target exactly, providing a simple independent check of the indexing convention.
Assumptions and supported limits
The resource cap counts visited dynamic-programming states and aborts before returning an incomplete total. A resource-limit error is distinct from a zero count.
Target coordinates are bounded to keep the finite state space suitable for interactive use. Negative generators are not supported: they can destroy the coordinatewise multiplicity bound and may create infinitely many factorizations through nonnegative relations. This page also does not calculate the entire semigroup's Hilbert basis, defining ideal, holes or normality certificate.
Use the result with related calculations
Use the calculator for small coupled composition or inventory equations where each generator consumes several nonnegative integer resources. Interpret the count according to whether generator labels represent distinct types.
Reordering rows changes the order of witness coefficients but leaves the total count unchanged when the same labeled types are retained. Scaling all generators and the target by the same positive integer should also preserve the coefficient count; scaling only the target defines a genuinely different factorization problem. The zero target has one factorization when every generator is nonzero and nonnegative: all coefficients vanish. This boundary case is important for the recursion's terminal condition. It also distinguishes a factorization count from a count of nonempty constructions, which would intentionally omit that solution. If the target has a zero coordinate, every generator with a positive entry in that coordinate must receive coefficient zero, often reducing the dimensional problem before any search is needed.
A few questions, answered
What is counted as one factorization?
One nonnegative integer coefficient vector in the supplied generator order is counted as one factorization.
Why is a zero generator rejected?
Its coefficient could grow arbitrarily without changing the target, creating infinitely many factorizations for reachable targets.
Do duplicate generators change the count?
Yes. Generator rows remain labeled; removing duplicates is appropriate only when identical types should be indistinguishable.
Is a state-cap error the same as nonmembership?
No. It means the computation did not finish and no complete count or membership conclusion is returned.