Bases: sage.sets.integer_range.IntegerRangeInfinite
The enumerated set of positive integers. To fix the ideas, we mean .
This class implements the set of positive integers, as an enumerated set (see InfiniteEnumeratedSets).
This set is an integer range set. The construction is therefore done by IntegerRange (see IntegerRange).
EXAMPLES:
sage: PP = PositiveIntegers()
sage: PP
Positive integers
sage: PP.cardinality()
+Infinity
sage: TestSuite(PP).run()
sage: PP.list()
...
NotImplementedError: infinite list
sage: it = iter(PP)
sage: (it.next(), it.next(), it.next(), it.next(), it.next())
(1, 2, 3, 4, 5)
sage: PP.first()
1
TESTS:
sage: TestSuite(PositiveIntegers()).run()
Returns an element of self.
EXAMPLES:
sage: PositiveIntegers().an_element()
42