A number theoretic character, also called a Dirichlet character (because Dirichlet first introduced them in his famous proof that every arithmetic progression with relatively prime initial term and common difference contains infinitely many primes), modulo is a complex function for positive integer such that
(1)
 
(2)
 
(3)

for all , and
(4)

if . can only assume values which are roots of unity, where is the totient function.
Number theoretic characters are implemented in the Wolfram Language as DirichletCharacter[k, j, n], where is the modulus and is the index.