numrange¶
A numrange specifies a set of numbers or number pairs, triples, quadruples, quintuples, or sextuples used as a question source.
Integer ranges¶
Filters¶
Filters are appended with brackets and narrow down the preceding atom:
2-30[5] → multiples of 5 in 2–30: {5, 10, 15, 20, 25, 30}
2-30[^5] → integers in 2–30 that are NOT multiples of 5
2-30[3+1] → integers in 2–30 congruent to 1 mod 3: {4, 7, 10, 13, 16, 19, 22, 25, 28}
2-30[^3+1] → integers in 2–30 NOT congruent to 1 mod 3
Filters can be chained:
Decimal ranges¶
Both bounds must share the same decimal precision; the step is inferred from it.
A filter can use a decimal modulus matching that precision:
Cartesian products¶
× (or *) creates ordered products (e.g. pairs (a, b) with a ≤ b), drawn from several ranges:
2-9×2-9 → all pairs (a, b) with 2 ≤ a ≤ b ≤ 9
5×2-9 → pairs (5, b) for b in {2, …, 9}
0.001-9.999×10,100,1000 → pairs (x, m) for x in 0.001–9.999, m in {10, 100, 1000}
2-9×2-9×2-9 → all triples (a, b, c) with 2 ≤ a ≤ b ≤ c ≤ 9
When one factor is a single value (a singleton), it stays fixed in its
position and the a ≤ b ordering no longer applies: 5×2-9 yields
(5, 2), (5, 3), …, (5, 9), including pairs whose second value is smaller.
Global filters¶
A filter placed after a parenthesised product is applied independently to each range of the product:
(2-9×2-9)[2] → pairs (a, b), a ≤ b, with a and b both even (2–9)
(2-9×2-9)[^3] → pairs (a, b), a ≤ b, with neither value a multiple of 3
This differs from a filter local to a single range: 2-9[2]×2-9 would filter
only the first range, and 2-9×2-9[2] only the second.