# What is the mathematical operation corresponding to this definition of the Dirichlet Character group operation?

The Wolfram Language & System Documentation Center page for DirichletCharacter indicates Dirichlet characters modulo k form a group:

G[k_] := Table[DirichletCharacter[k, j, n], {j, EulerPhi[k]}]


The group operation is defined in terms of the k and j indices as follows:

add[DirichletCharacter[k_, j1_, n_],
DirichletCharacter[k_, j2_, n_]] :=
DirichletCharacter[k, Mod[j1 + j2, EulerPhi[k], 1], n]


Question: What is the mathematical operation corresponding to this definition of the group operation?

I tried the following definition which seems to produce a different result than the definition above. Whereas the definition above is based on k and j indices the definition below assumes char1 and char2 are of the form defined by char below.

addChar[char1_, char2_] := char1 char2

char[k_, j_] := Table[DirichletCharacter[k, j, n], {n, 1, k}]


Block[{k = 5, j1 = 2, j2 = 3, addResult},
addOld[DirichletCharacter[k, j1, n], DirichletCharacter[k, j2, n]];

{{1, 1, 1, 1, 0}, {1, -I, I, -1, 0}}


Here is the list of Dirichlet characters modulo k=5:

j$$\quad$$Character
1$$\quad$$1,1,1,1,0
2$$\quad$$1,i,-i,-1,0
3$$\quad$$1,-1,-1,1,0
4$$\quad$$1,-i,i,-1,0

DirichletCharacter[k, j, n] picks a particular ordering for possible Dirichlet characters modulo k.
What this means in practice is that you should treat the index j as a "black box" and undocumented. Even if it was completely documented, the group of characters is, in general, not cyclic, thus trying to understand the operation on charcters given by simply adding their indices modulo k is not going to be group theoretically sensible. The correct group operation is your addChar[] .