# Number Theory Functions

• From: avkalb <avkalb panix com>
• To: gnumeric-list gnome org
• Subject: Number Theory Functions
• Date: Mon, 15 Mar 2010 11:27:12 -0500

```Using Gnumeric Spreadsheet 1.10.1 and 64-bit Sidux.

The Gnumeric Manual, Version 1.10, section A13 indicates some number theory
calculations are available.  I have briefly examined a few:

Some functions give me reasonable outputs for simple test inputs:
Isprime, ithprime, nt_pi,  nt_sigma, and pfactor.

```
But nt_d doesn't seem to work as I expected. nt_d(n) is supposed to calculate the number of divisors of n
```according to function reference A13 in The Gnumeric Manual, Version 1.10

```
If you select the insert function from the menu bar and then select nt_d from the listing, an example is given that nt_d(4096) = 13. In actuality, 2^12 = 4096 i.e there are 12 divisors of 2 in 4096. If 1 also is included
```as a divisor then 13 would be correct.

But that doesn't explain the following results:

```
nt_d(15) = 4 nt_d(21) = 4
```nt_d(70) =  8

though it would explain these:
n             7    11    31    16
nt_d(n)    2     2      2      5

```
What's wrong? Am I misinterpreting what the function is supposed to do? Any suggestions?
```

```