NT_D Function (Gnumeric)
Count positive divisors in Gnumeric with NT_D, using factorization examples, perfect-square checks and exact native domain diagnostics.
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: =NT_D(1) gives 1 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 NT_D returns
NT_D counts the positive divisors of a positive integer, including 1 and the integer itself. The divisors of 12 are 1, 2, 3, 4, 6 and 12, so the result is 6. It does not count only proper divisors or distinct prime factors. Versioned function help.
Syntax and arguments
=NT_D(n)
n is one required numeric argument. The wrapper floors its numeric input before enforcing the positive-domain and version-specific range guard. For example, NT_D(9.9) counts the divisors of 9 and returns 3. The value at 1 is 1 because 1 has exactly one positive divisor.
Reproducible examples
These eight native integer results were independently checked by binary arithmetic or elementary number theory.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=NT_D(1) |
1 |
=NT_D(2) |
2 |
=NT_D(4) |
3 |
=NT_D(9) |
3 |
=NT_D(12) |
6 |
=NT_D(36) |
9 |
=NT_D(60) |
12 |
=NT_D(4096) |
13 |
Practical worksheet
A divisor-count table can use positive integers in A2:A10 and =NT_D(A2) beside each one. Powers of a prime are especially easy to check: 4096=2^12 has exactly 13 positive divisors, corresponding to exponents 0 through 12.
For a prime number, the count is 2. For a composite number, it exceeds 2. This mathematical classification assumes valid positive integers and does not turn an error value or floored fractional input into a primality result.
Advanced interpretation and checks
For n=p1^a1×…×pk^ak, each positive divisor chooses one exponent from 0 through ai for each prime. The divisor count is therefore (a1+1)×…×(ak+1). Since 12=2²×3, =NT_D(12)-(2+1)*(1+1) returned 0.
Divisors usually pair as d and n/d. A perfect square has one unpaired square-root divisor, so its positive-divisor count is odd. The rows for 4, 9 and 36 illustrate this with 3, 3 and 9. This is a statement about count parity, not a claim that an odd count means n itself is odd.
Version-specific source differences
For the standard binary64 build, the older shared input bound is 2^52 = 4503599627370496. The pinned 1.12.62 expression raises it to 2^53 = 9007199254740992. This change is established by comparing the older bound with the current bound; it is not a native test of 1.12.62. Input acceptance and exact representability of every resulting integer are separate questions.
Boundaries and troubleshooting
The retained diagnostics separate malformed text, missing arguments and invalid numeric inputs. Zero and an empty cell produce #NUM!; the empty argument list produces #N/A. The numeric wrapper guard differs between the tested older build and current source, so large-input assumptions must be version-specific.
F5 is an actually empty cell. Listed errors are native error results, not mathematical zeroes.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=NT_D(0) |
#NUM! |
=NT_D(-1) |
#NUM! |
=NT_D(0.9) |
#NUM! |
=NT_D(9.9) |
3 |
=NT_D("abc") |
#VALUE! |
=NT_D(F5) |
#NUM! |
=NT_D(TRUE()) |
1 |
=NT_D() |
#N/A |
=NT_D(9007199254740994) |
#NUM! |
Official evidence and checking scope
- Current worksheet implementation
- Tested-version worksheet implementation
- Current calculation helper
- Tested-version calculation helper
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.