# Number Theory

## ISPRIME

ISPRIME whether n is prime

### Synopsis

`ISPRIME(n)`

### Arguments

n: positive integer

### Description

ISPRIME returns TRUE if n is prime and FALSE otherwise.

## ITHPRIME

ITHPRIME ith prime

### Synopsis

`ITHPRIME(i)`

### Arguments

i: positive integer

### Description

ITHPRIME finds the ith prime.

## NT_D

NT_D number of divisors

### Synopsis

`NT_D(n)`

### Arguments

n: positive integer

### Description

NT_D calculates the number of divisors of n.

## NT_MU

NT_MU Möbius mu function

### Synopsis

`NT_MU(n)`

### Arguments

n: positive integer

### Description

NT_MU function (Möbius mu function) returns 0 if n is divisible by the square of a prime. Otherwise, if n has an odd number of different prime factors, NT_MU returns -1, and if n has an even number of different prime factors, it returns 1. If n = 1, NT_MU returns 1.

## NT_OMEGA

NT_OMEGA Number of distinct prime factors

### Synopsis

`NT_OMEGA(n)`

### Arguments

n: positive integer

### Note

Returns the number of distinct prime factors without multiplicity.

## NT_PHI

NT_PHI Euler's totient function

### Synopsis

`NT_PHI(n)`

### Arguments

n: positive integer

### Note

Euler's totient function gives the number of integers less than or equal to n that are relatively prime (coprime) to n.

## NT_PI

NT_PI number of primes upto n

### Synopsis

`NT_PI(n)`

### Arguments

n: positive integer

### Description

NT_PI returns the number of primes less than or equal to n.

### Synopsis

`NT_RADICAL(n)`

### Arguments

n: positive integer

### Note

The function computes the product of its distinct prime factors

## NT_SIGMA

NT_SIGMA sigma function

### Synopsis

`NT_SIGMA(n)`

### Arguments

n: positive integer

### Description

NT_SIGMA calculates the sum of the divisors of n.

## PFACTOR

PFACTOR smallest prime factor

### Synopsis

`PFACTOR(n)`

### Arguments

n: positive integer

### Description

PFACTOR finds the smallest prime factor of its argument.

### Note

The argument n must be at least 2. Otherwise a #VALUE! error is returned.