Some basic tests
This section describes some basic tests on numerical semigroups.The first described tests refer to the way the semigroup was created. Then are presented functions to test if a given list represents the small elements, gaps or the Apéry set (see ) of a numerical semigroup; to test if an integer belongs to a numerical semigroup and if a numerical semigroup is a subsemigroup of another one.

NS is a numerical semigroup and these attributes are available (their names should be self explanatory). gap> s:=NumericalSemigroup(3,7); <Numerical semigroup with 2 generators> gap> AperyListOfNumericalSemigroupWRTElement(s,30);; gap> t:=NumericalSemigroupByAperyList(last); <Numerical semigroup> gap> IsNumericalSemigroupByGenerators(s); true gap> IsNumericalSemigroupByGenerators(t); false gap> IsNumericalSemigroupByAperyList(s); false gap> IsNumericalSemigroupByAperyList(t); true
Tests if the list L (which has to be a set) may represent the ``small" # elements of a numerical semigroup. gap> L:=[ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ]; [ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ] gap> RepresentsSmallElementsOfNumericalSemigroup(L); true gap> L:=[ 6, 9, 11, 12, 14, 15, 17, 18, 20 ]; [ 6, 9, 11, 12, 14, 15, 17, 18, 20 ] gap> RepresentsSmallElementsOfNumericalSemigroup(L); false
Tests if the list L may represent the gaps (see ) of a numerical semigroup. gap> s:=NumericalSemigroup(3,7); <Numerical semigroup with 2 generators> gap> L:=GapsOfNumericalSemigroup(s); [ 1, 2, 4, 5, 8, 11 ] gap> RepresentsGapsOfNumericalSemigroup(L); true gap> L:=Set(List([1..21],i->RandomList([1..50]))); [ 2, 6, 7, 8, 10, 12, 14, 19, 24, 28, 31, 35, 42, 50 ] gap> RepresentsGapsOfNumericalSemigroup(L); false
Tests whether a list L of integers may represent the Apéry list of a numerical semigroup. It returns true when the periodic function represented by L is subadditive (see ) and the remainder of the division of L[i] by the length of L is i and returns false otherwise (the crieterium used is the one explained in ). gap> IsAperyListOfNumericalSemigroup([0,21,7,28,14]); true
S and T are numerical semigroups. Tests whether T is contained in S. gap> S := NumericalSemigroup("modular", 5,53); <Modular numerical semigroup satisfying 5x mod 53 <= x > gap> T := NumericalSemigroup(2,3); <Numerical semigroup with 2 generators> gap> IsSubsemigroupOfNumericalSemigroup(T,S); true gap> IsSubsemigroupOfNumericalSemigroup(S,T); false
n is an integer and S is a numerical semigroup. Tests whether n belongs to S. n in S is the short for BelongsToNumericalSemigroup(n,S). gap> S := NumericalSemigroup("modular", 5,53); <Modular numerical semigroup satisfying 5x mod 53 <= x > gap> BelongsToNumericalSemigroup(15,S); false gap> 15 in S; false gap> SmallElementsOfNumericalSemigroup(S); [ 0, 11, 12, 13, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 43 ] gap> BelongsToNumericalSemigroup(13,S); true gap> 13 in S; true