ITHPRIME Function (Gnumeric)
Find indexed prime numbers with Gnumeric ITHPRIME, using one-based indices, native examples and explicit source limits for large requests.
Verification status: 18 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Retained native records and independent integer calculations were checked. Version 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =ITHPRIME(1) gives 2 in the tested Gnumeric 1.12.57 build.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Number Theory plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check were recalculated with 1.12.57 ssconvert. Current 1.12.62 source was inspected; the later release was not executed.
What ITHPRIME returns
ITHPRIME returns the prime at a one-based position in the increasing prime sequence. The first prime is 2, the second is 3 and the seventh is 17. The input is an index, not the number whose primality should be tested. Versioned function help.
Syntax and arguments
=ITHPRIME(index)
index is one required numeric argument. The implementation floors it before checking the domain. Thus 9.9 selects the ninth prime, 23. The usable index must be positive. The native boolean TRUE case becomes 1 and returns the first prime; an empty cell becomes zero and is rejected.
Reproducible examples
These eight native integer results were independently checked by binary arithmetic or elementary number theory.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=ITHPRIME(1) |
2 |
=ITHPRIME(2) |
3 |
=ITHPRIME(3) |
5 |
=ITHPRIME(7) |
17 |
=ITHPRIME(10) |
29 |
=ITHPRIME(20) |
71 |
=ITHPRIME(50) |
229 |
=ITHPRIME(100) |
541 |
Practical worksheet
For a small prime lookup table, enter consecutive positive indices in column A and use =ITHPRIME(A2) in column B. The literal examples below establish the first, seventh, twentieth and hundredth positions. In particular, =ITHPRIME(100) gives 541.
Do not confuse ITHPRIME(100) with a count of primes up to 100. One asks for a position in the sequence; the other asks how many primes lie below a cutoff. That distinction matters when labeling a table or interpreting a lookup.
Advanced interpretation and checks
Every returned prime greater than one is its own smallest prime factor. The composed check =PFACTOR(ITHPRIME(100)) returned 541, matching the direct hundredth-prime result. Independent trial division confirms that 541 has no prime divisor at or below its square root.
The source maintains a cached prime table and expands it in chunks. That implementation can consume substantial time or memory even though the formula is short. The ordinary examples stop at index 100; they are not a performance benchmark for the documented upper bounds.
Version-specific source differences
The retained 1.12.57 and 1.12.62 sources both use a 100000000-position helper limit. No first-introduction date or retirement is inferred from those snapshots. The tested ordinary outputs and the source-only large-index guard are identified separately.
Boundaries and troubleshooting
The wrapper rejects an index below 1 or above INT_MAX with #NUM!. On the tested build, 2147483648 follows that guard. Both retained version sources also impose a helper limit of 100000000; an index above that helper limit but within the wrapper range leads to #LIMIT! by source inspection. That large-index branch was not executed. Invalid text and missing arguments have their own errors.
F5 is an actually empty cell. Listed errors are native error results, not mathematical zeroes.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=ITHPRIME(0) |
#NUM! |
=ITHPRIME(-1) |
#NUM! |
=ITHPRIME(0.9) |
#NUM! |
=ITHPRIME(9.9) |
23 |
=ITHPRIME("abc") |
#VALUE! |
=ITHPRIME(F5) |
#NUM! |
=ITHPRIME(TRUE()) |
2 |
=ITHPRIME() |
#N/A |
=ITHPRIME(2147483648) |
#NUM! |
Official evidence and checking scope
- Current worksheet implementation
- Tested-version worksheet implementation
- Current calculation helper
- Tested-version calculation helper
- Current prime-table limit
The retained workbook contained a deliberately stale SUM cache and an uncached SUM formula, both recalculated correctly. Native evidence covers the listed 1.12.57 cases. Other worksheet layouts and mathematical interpretations are separately explained checks. GUI entry, other locales and later-release output were not tested.