integer-pairs
Generating integer pairs produces tuples (i, j) where i and j range over integers β useful for grid coordinates, test-case enumeration, combinatorial problems, and data-fixture generation. The ZTools Integer Pairs tool builds the Cartesian product i Γ j over user-defined ranges, with optional filters (i < j, i + j = constant, distinct, etc.). Output as JSON array of pairs, CSV, or human-readable list. Lazy evaluation handles large ranges without blowing browser memory.
Use casesβ
Generate grid coordinatesβ
5Γ5 grid: pairs (0,0), (0,1), ..., (4,4) β 25 cells. Useful for board games, simulation seeds, image processing.
Test-case enumerationβ
Test a function f(a, b) for all pairs in [β5, 5] Γ [β5, 5]. 121 cases. Generator outputs them β feed directly to your test runner.
Combinatorial problemsβ
"All pairs (i, j) with i + j = 10 and i, j β [1, 10]". Constraint filtering finds them.
Generate test data for MLβ
Synthetic feature pairs for regression / classification testing. Predictable ranges, no random surprises.
How it worksβ
- Set ranges β Range for i (start, end, step). Range for j (separate start, end, step). Or one range used for both.
- Apply filter β i < j (no duplicates), i + j = constant, GCD(i, j) = 1 (coprime), or custom expression.
- Pick output format β JSON array of [i, j] pairs, CSV (i,j per row), or "i j" pairs separated by newlines.
- Generate + copy β For very large outputs (>10k pairs), download as file rather than copy.
Examplesβ
Input: i β [0, 2], j β [0, 2]
Output: 9 pairs: (0,0), (0,1), (0,2), (1,0), ..., (2,2).
Input: i, j β [1, 10] with i < j
Output: 45 pairs (10 choose 2): (1,2), (1,3), ..., (9,10).
Input: i, j β [1, 10] with i + j = 10
Output: Pairs where sum is 10: (0, 10), (1, 9), (2, 8), ..., (10, 0). Filter to "i β€ j" if you want unique combinations.
Frequently asked questionsβ
Maximum number of pairs?
Browser limit is ~10 million in memory. For more, use a streaming download mode (lazy generation, write directly to file).
Can I include negative integers?
Yes β set range start to a negative number.
Custom step?
Yes β non-1 steps are supported (e.g. only even integers).
Output ordering?
Lexicographic by default β (0,0), (0,1), (0,2), (1,0), ... Can switch to "i first then j" or column-major if needed.
Privacy?
All in browser.
Tipsβ
- For symmetric problems (where (i,j) = (j,i) doesn't add info), use the i < j filter β halves the output count.
- For very large ranges, prefer downloading the file β copying 10 million pairs to clipboard freezes the browser.
- For combinatorial constraints, use the custom expression filter β supports arbitrary boolean conditions on (i, j).
- For test cases, also generate edge values (0, max, min, off-by-one) explicitly β uniform grids miss boundary bugs.
Try it nowβ
The full integer-pairs runs in your browser at https://ztools.zaions.com/integer-pairs β no signup, no upload, no data leaves your device.
Last updated: 2026-05-06 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub