Number Theory
- ISPRIME — whether n is prime
- ITHPRIME — ith prime
- NT_D — number of divisors
- NT_MU — Möbius mu function
- NT_OMEGA — Number of distinct prime factors
- NT_PHI — Euler's totient function
- NT_PI — number of primes upto n
- NT_RADICAL — Radical function
- NT_SIGMA — sigma function
- PFACTOR — smallest prime factor
ISPRIME
Synopsis
ISPRIME(n)
Arguments
n: positive integer
Description
ISPRIME returns TRUE if n is prime and FALSE otherwise.
ITHPRIME
Synopsis
ITHPRIME(i)
Arguments
i: positive integer
Description
ITHPRIME finds the ith prime.
NT_D
Synopsis
NT_D(n)
Arguments
n: positive integer
Description
NT_D calculates the number of divisors of n.
NT_MU
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
Synopsis
NT_OMEGA(n)
Arguments
n: positive integer
Note
Returns the number of distinct prime factors without multiplicity.
NT_PHI
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
Synopsis
NT_PI(n)
Arguments
n: positive integer
Description
NT_PI returns the number of primes less than or equal to n.
NT_RADICAL
Synopsis
NT_RADICAL(n)
Arguments
n: positive integer
Note
The function computes the product of its distinct prime factors
NT_SIGMA
Synopsis
NT_SIGMA(n)
Arguments
n: positive integer
Description
NT_SIGMA calculates the sum of the divisors of n.