WOLFRAM

OddQ[expr]

gives True if expr is an odd integer, and False otherwise.

Details

  • OddQ[expr] returns False unless expr is manifestly an odd integer (i.e. has head Integer, and is odd).

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Test whether 9 is odd:

Out[1]=1

OddQ gives False for non-numeric expressions:

Out[1]=1

Applications  (1)Sample problems that can be solved with this function

Test whether a vector consists of odd integers:

Out[1]=1
Out[2]=2

Properties & Relations  (2)Properties of the function, and connections to other functions

An integer is either odd or even. Use EvenQ to check that an integer is even:

Out[1]=1
Out[2]=2

Odd integers are not divisible by 2:

Out[1]=1
Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

Expressions that represent odd integers but do not evaluate explicitly will still give False:

Out[2]=2

It is necessary to use symbolic simplification first:

Out[3]=3
Wolfram Research (1988), OddQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OddQ.html.
Wolfram Research (1988), OddQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OddQ.html.

Text

Wolfram Research (1988), OddQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OddQ.html.

Wolfram Research (1988), OddQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OddQ.html.

CMS

Wolfram Language. 1988. "OddQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OddQ.html.

Wolfram Language. 1988. "OddQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OddQ.html.

APA

Wolfram Language. (1988). OddQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OddQ.html

Wolfram Language. (1988). OddQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OddQ.html

BibTeX

@misc{reference.wolfram_2025_oddq, author="Wolfram Research", title="{OddQ}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/OddQ.html}", note=[Accessed: 08-June-2025 ]}

@misc{reference.wolfram_2025_oddq, author="Wolfram Research", title="{OddQ}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/OddQ.html}", note=[Accessed: 08-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_oddq, organization={Wolfram Research}, title={OddQ}, year={1988}, url={https://reference.wolfram.com/language/ref/OddQ.html}, note=[Accessed: 08-June-2025 ]}

@online{reference.wolfram_2025_oddq, organization={Wolfram Research}, title={OddQ}, year={1988}, url={https://reference.wolfram.com/language/ref/OddQ.html}, note=[Accessed: 08-June-2025 ]}