odd
Returns true
iff its argument is an odd number.
Syntax
-
odd(n)
-
n
is an integer
-
Description
odd(n)
is true
iff n
is an odd number (that is, on the form 2m + 1 for some integer m).
If the argument isn’t an integer, an error is generated.
Examples
L ≔ SequenceList(1000); count(L, odd)/#L
1/2 (=0.5)
L ≔ SequenceList(10000) @ (n ↦ mod(n^2, 19)); count(L, odd)/#L
1263/2000 (=0.6315)