represents the domain of strictly positive integers, as in x∈PositiveIntegers.
PositiveIntegers
represents the domain of strictly positive integers, as in x∈PositiveIntegers.
Details
- x∈PositiveIntegers evaluates immediately if x is a numeric quantity.
- Simplify[expr∈PositiveIntegers,assum] can be used to try to determine whether an expression is a positive integer under the given assumptions.
- (x1|x2|…)∈PositiveIntegers and {x1,x2,…}∈PositiveIntegers test whether all xi are positive integers.
- PositiveIntegers is output in StandardForm or TraditionalForm as
. This typeset form can be input using
pints
.
Examples
open all close allBasic Examples (3)
Scope (6)
Test domain membership of a numeric expression:
1234567∈PositiveIntegersMake domain membership assumptions:
Refine[n ^ 3 ≥ n, n∈PositiveIntegers]FullSimplify[x ^ n + y ^ n == z ^ n, (x | y | z | n)∈PositiveIntegers && n > 3]Specify the default domain over which a function should work:
Reduce[(x ^ 999997 - 25x ^ 12345 + 24x)(x - 7)(x ^ 2 - 9) == 0, x, PositiveIntegers]FindInstance[x ^ 2 + y ^ 2 + z ^ 2 + t ^ 2 + u ^ 2 + v ^ 2 + w ^ 2 == 1234567890987654321, {x, y, z, t, u, v, w}, PositiveIntegers]Solve an optimization problem over the positive integers:
Minimize[{x ^ 2 + x y}, {x, y}, PositiveIntegers]Test whether several numbers are positive integers:
(x | y | 1)∈PositiveIntegersIf any number is explicitly not a positive integer, the result is False:
{x, y, -1}∈PositiveIntegersTraditionalForm formatting:
PositiveIntegers//TraditionalFormApplications (1)
Testing membership in the positive integers is a fast way to verify positivity of a large list of integers:
list = RandomInteger[{1, 100}, 1000000];AbsoluteTiming[list∈PositiveIntegers]AbsoluteTiming[MatchQ[list, {__Integer ? Positive}]]Properties & Relations (3)
Membership in PositiveIntegers is equivalent to membership in Integers along with positivity:
x∈PositiveIntegersPositiveIntegers is contained in PositiveReals and PositiveRationals:
Refine[x∈PositiveReals, x∈PositiveIntegers]Refine[x∈PositiveRationals, x∈PositiveIntegers]PositiveIntegers is disjoint from NonPositiveIntegers and NegativeIntegers:
Refine[x∈NonPositiveIntegers, x∈PositiveIntegers]Refine[x∈NegativeIntegers, x∈PositiveIntegers]Related Guides
History
Text
Wolfram Research (2019), PositiveIntegers, Wolfram Language function, https://reference.wolfram.com/language/ref/PositiveIntegers.html.
CMS
Wolfram Language. 2019. "PositiveIntegers." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PositiveIntegers.html.
APA
Wolfram Language. (2019). PositiveIntegers. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PositiveIntegers.html
BibTeX
@misc{reference.wolfram_2026_positiveintegers, author="Wolfram Research", title="{PositiveIntegers}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/PositiveIntegers.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_positiveintegers, organization={Wolfram Research}, title={PositiveIntegers}, year={2019}, url={https://reference.wolfram.com/language/ref/PositiveIntegers.html}, note=[Accessed: 12-June-2026]}