# A Menon-type Identity concerning Dirichlet characters and a generalization
of the gcd function

Arya Chandran  Department of Mathematics, University College,
Thiruvananthapuram, Kerala - 695034, India, Email :
<EMAIL_ADDRESS>K Vishnu Namboothiri Corresponding Author
Department of Mathematics, Government College, Ambalapuzha, Kerala - 688561,
INDIA
Department of Collegiate Education, Government of Kerala, Email :
<EMAIL_ADDRESS>Neha Elizabeth Thomas  Department of Mathematics, SD
College, Alappuzha, Kerala - 688003, India, Email<EMAIL_ADDRESS>
###### Abstract

Menon’s identity is a classical identity involving gcd sums and the Euler
totient function $\phi$. In a recent paper, Zhao and Cao derived the Menon-
type identity
$\sum\limits_{\begin{subarray}{c}k=1\end{subarray}}^{n}(k-1,n)\chi(k)=\phi(n)\tau(\frac{n}{d})$,
where $\chi$ is a Dirichlet character mod $n$ with conductor $d$. We derive an
identity similar to this replacing gcd with a generalization it. We also show
that some of the arguments used in the derivation of Zhao-Cao identity can be
improved if one uses the method we employ here.

##  1 Introduction

Menon’s identity that originally appeared in [9] is a gcd sum turning out to
be equal to a product of the Euler totient function $\phi$ and the number of
divisors function $\tau$. If $(m,n)$ denotes the gcd of $m$ and $n$, the
identity states that

$\displaystyle\sum\limits_{\begin{subarray}{c}m=1\\\
(m,n)=1\end{subarray}}^{n}(m-1,n)=\phi(n)\tau(n).$ (1)

This identity was generalized by several authors in various directions. For
example, B. Sury [12] derived the following Menon-type identity

$\sum\limits_{\begin{subarray}{c}1\leq m_{1},m_{2},\ldots,m_{s}\leq n\\\
(m_{1},n)=1\end{subarray}}(m_{1}-1,m_{2},\ldots,m_{s},n)=\phi(n)\sigma_{s-1}(n)$

where $\sigma_{s}(n)=\sum\limits_{d|n}d^{s}$ using properties of group
actions. When $s=1$, this becomes the Menon’s identity. Zhao and Cao [16]
recently derived another Menon-type identity

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\end{subarray}}^{n}(k-1,n)\chi(k)=\phi(n)\tau(\frac{n}{d})$
(2)

where $\chi$ is the Dirichlet character mod $n$ with conductor $d$. When
$\chi$ is the principal character mod $n$, this identity reduces to the
Menon’s identity. A generalization of this Zhao-Cao identity involving even
functions mod $n$ was derived by L. Tóth in [14].

For positive integers $a,b$ and $s$, E. Cohen [3] suggested a generalization
of the gcd function which we denote in this paper by $(a,b)_{s}$ (see next
section for the definition of this function). In [2], the authors of this
paper proposed a generalization to the Menon’s identity which was obtained by
replacing the gcd function with $(a,b)_{s}$. Various other generalizations of
the Menon’s identity were provided by many authors. See, for example [4], [6],
[11], [13] and the more recent papers [5] and [15].

The Klee’s function $\Phi_{s}$ is a natural generalization of the Euler
totient function. The generalized divisor function $\tau_{s}$ defined in [2]
generalizes the usual divisor function $\tau$ (see next section for the
definitions of these generalizations). A natural question arising is if the
gcd function in the Zhao-Cao identity (2) is replaced with the generalized gcd
function suggested by E. Cohen, what could be the possible change that can
happen to this identity. We propose here a Menon-type identity modifying the
identity (2) replacing the gcd function appearing in (2) with generalized gcd
function. Our techniques closely follow the style of arguments appearing in
[16]. The main results we propose in this paper are the following.

######  Theorem 1.1.

Let $s,n\in\mathbb{N}$ and $\chi$ be a primitive Dirichlet character mod $n$,
where $n$ is the $s^{th}$ power of some natural number. Then

$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi(k)=\Phi_{s}(n).$

######  Theorem 1.2.

Let $\chi$ be a Dirichlet character mod $n$, where $n=m^{qs}$,
$m,q,s\in\mathbb{N}$. If $d=m^{ts}$, $1\leq t\leq q$ is the conductor of
$\chi$ then

$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi(k)=\Phi_{s}(n)\tau_{s}(n/d).$

##  2 Notations and basic results

Most of the notations, functions and identities we use in this paper are
standard and their definitions can be found in [1]. We give below the
definitions of some other less popular terms and functions which we use in
this paper.

######  Definition 2.1 ([3]).

For positive integers $a,b$ and $s$ the generalized gcd of $a$ and $b$ denoted
by $(a,b)_{s}$ is defined to be the largest $l^{s}$ (where $l\in\mathbb{N}$)
dividing both $a$ and $b$.

$(a,b)_{1}$ is thus the usual gcd of $a$ and $b$. Like the gcd function,
$(a,b)_{s}=(b,a)_{s}$.

The next statement is elementary and can be proved easily. We state it without
proof.

######  Lemma 2.2.

$(a,b)_{s}$ is multiplicative in first variable.

It can be further observed that $(a,b)_{s}$ is not completely multiplicative
as a single variable function of $a$. Also, it is not multiplicative in $s$.

######  Definition 2.3.

If $(a,b)_{s}=1$, then we say that $a$ and $b$ are relatively $s$-prime to
each other.

######  Definition 2.4 ([7]).

The Klee’s function $\Phi_{s}(n)$ is defined as the cardinality of the set
$\\{m\in\mathbb{N}:1\leq m\leq n,(m,n)_{s}=1\\}$.

Thus $\Phi_{s}(n)$ denotes the number of positive integers $\leq n$ that are
relatively $s$-prime to $n$. Various properties satisfied by $\Phi_{s}(n)$ are
listed in [2, Section 2].

If $M$ is a complete residue system mod $n$, then the subset of elements from
$M$ that are relatively $s$-prime to $n$ is called an $s$-reduced system.
Further, if $M$ is a subset of $\\{a:0\leq a<n\\}$ then the $s$-reduced system
is called a minimal $s$-reduced residue system (mod $n$).

######  Definition 2.5.

For natural numbers $n$ and $s$, by $\tau_{s}(n)$ we mean the number of
$l^{s}$ dividing $n$ where $l\in\mathbb{N}$.

It was observed in [2] that $\Phi_{s}(n)$ and $\tau_{s}(n)$ are multiplicative
in $n$.

The following lemma is essential to prove one of the main results that we
propose in this paper.

######  Lemma 2.6.

[3, Lemma 3] Let $A=\\{m\mid 1\leq m\leq n\text{ and }(m,n)_{s}=1\\}$ and let
$d>0$ be any $s$th power divisor of $n$. Then $A$ is the union of
$\frac{\Phi_{s}(n)}{\Phi_{s}(d)}$ disjoint sets each of which is an
$s$-reduced residue system mod $d$.

##  3 Proofs of the main results

We here provide proofs of the claims we made in the first section. To prove
Theorem 1.1, we need the following lemma.

######  Lemma 3.1.

Let $s,n\in\mathbb{N}$ and $\chi$ be a primitive Dirichlet character mod
$p^{n}$, where $p$ is prime and $n$ is a multiple of $s$. If $m$ is a multiple
of $s$ such that $s\leq m<n$, then

$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)=\begin{cases}-1,\quad
m=n-s\\\ 0,\quad\text{ otherwise.}\end{cases}$

###### Proof.

By the conditions imposed on $s,m$ and $n$ we see that $n\neq s$. Suppose
$m=n-s$. Since $p^{n-s}$ is not an induced modulus for $\chi$, there exists an
integer $b$, $1\leq b<p^{s}$ with $(bp^{n-s}+1,p^{n})=1$ and $bp^{n-s}+1\equiv
1(\text{mod }p^{n-s})$, but $\chi(bp^{n-s}+1)\neq 1$. So

$\displaystyle\chi(bp^{n-s}+1)\sum\limits_{\begin{subarray}{c}{k=0}\end{subarray}}^{p^{s}-1}\chi(kp^{n-s}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}{k=0}\end{subarray}}^{p^{s}-1}\chi(kbp^{2n-2s}+bp^{n-s}+kp^{n-s}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}{k=0}\end{subarray}}^{p^{s}-1}\chi((k+b)p^{n-s}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}{k=0}\end{subarray}}^{p^{s}-1}\chi(kp^{n-s}+1).$

Hence
$\sum\limits_{\begin{subarray}{c}{k=0}\end{subarray}}^{p^{s}-1}\chi(kp^{n-s}+1)=0$
and so
$\sum\limits_{\begin{subarray}{c}{k=1}\end{subarray}}^{p^{s}}\chi(kp^{n-s}+1)=0$.
It follows that

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{s})_{s}=1\end{subarray}}^{p^{s}}\chi(kp^{n-s}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\end{subarray}}^{p^{s}}\chi(kp^{n-s}+1)-\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{s})_{s}\neq 1\end{subarray}}^{p^{s}}\chi(kp^{n-s}+1)$
$\displaystyle=-\sum\limits_{\begin{subarray}{c}k=1\\\ (k,p^{s})_{s}\neq
1\end{subarray}}^{p^{s}}\chi(kp^{n-s}+1)$ $\displaystyle=-\chi(kp^{n}+1)$
$\displaystyle=-\chi(1)$ $\displaystyle=-1$

Next we consider the case $m\neq n-s$. As in the previous case.

$\displaystyle\chi(bp^{n-s}+1)\sum\limits_{\begin{subarray}{c}{k=1}\\\
{(k,p^{n-m})_{s}=1}\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}{k=1}\\\
{(k,p^{n-m})_{s}=1}\end{subarray}}^{p^{n-m}}\chi(bkp^{m}p^{n-s}+kp^{m}+bp^{n-s}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}{k=1}\\\
{(k,p^{n-m})_{s}=1}\end{subarray}}^{p^{n-m}}\chi(kp^{m}+bp^{n-s}+1)$

We claim that $\\{kp^{m}+bp^{n-s}+1:1\leq k\leq p^{n-m},(k,p^{n-m})_{s}=1\\}$
is the same as the residue system $kp^{m}+1$ mod $p^{n}$. Suppose $1\leq
k_{1}\leq p^{n-m}$ and $(k_{1},p^{n-m})_{s}=1$. If $c\equiv
k_{1}p^{m}+bp^{n-s}+1\text{ (mod $p^{n}$)}$ for some integer $c$, then let
$k_{2}\equiv k_{1}+bp^{n-s-m}\text{ (mod $p^{n-m}$)}$. Note that if
$(k_{2},p^{n-m})_{s}=p^{rs}$ for some prime $p$ and $1\leq
r\leq\frac{n-m}{s}$, then we have $p^{s}\mid k_{2}$, which implies $p^{s}\mid
k_{1}+bp^{n-s-m}$. But in this case $s\leq m\leq n-2s$ and $p^{s}\mid
p^{n-s-m}$ implying that $p^{s}\mid k_{1}$ which is not possible. Therefore
$(k_{2},p^{n-m})_{s}=1$ and also $1\leq k_{2}\leq p^{n-m}$. Now we have
$k_{2}p^{m}+1\equiv c\text{ (mod $p^{n}$)}$. If
$k_{1}p^{m}+bp^{n-s}+1={k_{1}}^{\prime}p^{m}+bp^{n-s}+1\text{ (mod $p^{n}$)}$
then $k_{1}\equiv k_{1}^{\prime}\text{ (mod $p^{n-m}$)}$. Similarly if
$k_{2}p^{m}+1\equiv k_{2}^{\prime}p^{m}+1\text{ (mod $p^{n}$)}$ then
$k_{2}\equiv k_{2}^{\prime}\text{ (mod $p^{n-m}$)}$. Therefore both these
residue systems consists of $\Phi_{s}(p^{n-m})$ different elements, and so we
get $\chi(bp^{n-s}+1)\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)$. This implies that
$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)=0$ which is what we
required. ∎

###### Proof of Theorem 1.1.

Let $f(n)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi_{n}(k)$, where $\chi_{n}$ is
some Dirichlet character mod $n$. For $r,t\in\mathbb{N}$, we have
$f(rt)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,rt)_{s}=1\end{subarray}}^{rt}(k-1,rt)_{s}\chi_{rt}(k)$. Now we use the fact
that if $(r,t)=1$ then the two sets $\\{k\mid 1\leq k\leq rt,(k,rt)_{s}=1\\}$
and $\\{tk_{1}+rk_{2}\mid 1\leq k_{1}\leq r,(k_{1},r)_{s}=1,1\leq k_{2}\leq
t,(k_{2},t)_{s}=1\\}$ are the same. Note that $\chi$ mod $k$ can be factored
uniquely as a product of the form
$\chi_{k}=\chi_{k_{1}}\chi_{k_{2}}\cdots\chi_{k_{r}}$, where
$k=k_{1}k_{2}\cdots k_{r}$ with $(k_{i},k_{j})=1$ if $i\neq j$. In particular,
if $\chi$ is primitive then each $\chi_{k_{i}}$ is primitive mod $k_{i}$.
Since the generalized gcd function is multiplicative in the second variable,
we get

$\displaystyle f(rt)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k_{1}=1\\\
(k_{1},r)_{s}=1\end{subarray}}^{r}\sum\limits_{\begin{subarray}{c}k_{2}=1\\\
(k_{2},t)_{s}=1\end{subarray}}^{t}(tk_{1}+rk_{2}-1,r)_{s}(tk_{1}+rk_{2}-1,t)_{s}$
$\displaystyle\times\chi_{r}(tk_{1}+rk_{2})\chi_{t}(tk_{1}+rk_{2})$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k_{1}=1\\\
(k_{1},r)_{s}=1\end{subarray}}^{r}\sum\limits_{\begin{subarray}{c}k_{2}=1\\\
(k_{2},t)_{s}=1\end{subarray}}^{t}(tk_{1}+rk_{2}-1,r)_{s}(tk_{1}+rk_{2}-1,t)_{s}\chi_{r}(tk_{1})\chi_{t}(rk_{2}),$

Now we observe that $(tk_{1}+rk_{2}-1,r)_{s}=(tk_{1}-1,r)_{s}$ and
$(tk_{1}+rk_{2}-1,t)_{s}=(rk_{2}-1,t)_{s}$. So

$\displaystyle f(rt)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k_{1}=1\\\
(k_{1},r)_{s}=1\end{subarray}}^{r}\sum\limits_{\begin{subarray}{c}k_{2}=1\\\
(k_{2},t)_{s}=1\end{subarray}}^{t}(tk_{1}-1,r)_{s}(rk_{2}-1,t)_{s}\chi_{r}(tk_{1})\chi_{t}(rk_{2})$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k_{1}=1\\\
(k_{1},r)_{s}=1\end{subarray}}^{r}(tk_{1}-1,r)_{s}\chi_{r}(tk_{1})\sum\limits_{\begin{subarray}{c}k_{2}=1\\\
(k_{2},t)_{s}=1\end{subarray}}^{t}(rk_{2}-1,t)_{s}\chi_{t}(rk_{2}).$

Since $(r,t)=1$,

$\displaystyle f(rt)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k_{1}=1\\\
(k_{1},r)_{s}=1\end{subarray}}^{r}(k_{1}-1,r)_{s}\chi_{r}(k_{1})\sum\limits_{\begin{subarray}{c}k_{2}=1\\\
(k_{2},t)_{s}=1\end{subarray}}^{t}(k_{2}-1,t)_{s}\chi_{t}(k_{2})$
$\displaystyle=f(r)f(t).$

Thus $f$ is multiplicative and so we need to verify our claim only for prime
powers $p^{a}$, where $a=qs$, $q\in\mathbb{N}$. Therefore

$\displaystyle f(p^{a})$ $\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}=1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)-\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}\neq 1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\ (k-1,p^{a})_{s}\neq
1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)+\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=1\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\ (k-1,p^{a})_{s}\neq
1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)+\sum\limits_{\begin{subarray}{c}k=1\\\
\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)-\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}\neq 1\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\ (k-1,p^{a})_{s}\neq
1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi_{p^{a}}(k)-\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}\neq 1\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\ (k-1,p^{a})_{s}\neq
1\end{subarray}}^{p^{a}}((k-1,p^{a})_{s}-1)\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q}\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}(p^{ts}-1)\chi_{p^{a}}(k)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{a}\end{subarray}}^{p^{a}}(p^{a}-1)\chi_{p^{a}}(k)+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}(p^{ts}-1)\chi_{p^{a}}(k)$
$\displaystyle=(p^{a}-1)+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}\chi_{p^{a}}(k).$

We need to compute the sum $\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)$. We have
$\sum\limits_{\begin{subarray}{c}k=1\\\
(k-1,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}\chi_{p^{a}}(k)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}\chi_{p^{a}}(k+1)$. To evaluate
this, for a fixed prime power $p^{ts}$ we take the sum over all those $k$ in
the range $1\leq k\leq p^{a}$ where $(k,p^{a})_{s}=p^{ts}$. If we write
$k=jp^{ts}$ then $1\leq k\leq p^{a}$ and $(k,p^{a})_{s}=1$ if and only if
$1\leq j\leq p^{a-ts}$ and $(j,p^{a-ts})_{s}=1$. Then the last sum can be re-
written as $\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}=p^{ts}\end{subarray}}^{p^{a}}\chi_{p^{a}}(k+1)=\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)$ and
$f(p^{a})=(p^{a}-1)+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)$. By Lemma
3.1, we obtain $\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)=\begin{cases}-1\text{
if }t=q-1\\\ 0\text{ otherwise}\end{cases}$. Then

$\displaystyle f(p^{a})$ $\displaystyle=p^{a}-1+(p^{(q-1)s}-1)(-1)$
$\displaystyle=p^{a}-p^{qs-s}$ $\displaystyle=p^{a}-p^{a-s}$
$\displaystyle=\Phi_{s}(p^{a}),\text{which concludes the proof.}$

∎

The above theorem reduces to Theorem 1.1 in [16] when $s=1$. We would like to
further remark that Theorem 1.1 in [16] was proved using Lemma 2.1 and Lemma
2.2 in [16]. If one employs the technique we used above, only [16, Lemma 2.1]
is required to prove [16, Theorem 1.1].

To prove Theorem 1.2, we require the following two lemmas. First lemma
generalizes [16, Lemma 2.4].

######  Lemma 3.2.

Let $s,n\in\mathbb{N}$ and $\chi$ be a Dirichlet character mod $p^{n}$, where
$n=qs$ for some $q\in\mathbb{N}$. Let $p^{l}$ be the conductor of $\chi$ where
$l=rs$ for some $r\in\mathbb{N}$ and $1\leq r\leq q$ . If $m$ is a multiple of
$s$ such that $s\leq m<n$, we have $\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)=\begin{cases}\Phi_{s}(p^{n-m}),\text{
if }l\leq m<n\\\ -p^{n-l},\text{ if }m=l-s\\\ 0,\text{ if }s\leq
m<l-s.\end{cases}$

###### Proof.

First we consider the case $l\leq m<n$. We have

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}1$
$\displaystyle=\Phi_{s}(p^{n-m}).$

Next we move on to the case $s\leq m\leq l-s$. Note that every Dirichlet
character $\chi$ mod $k$ can be expressed as a product of the form
$\chi(n)=\psi(n)\chi_{1}(n)$ for all $n$, where $\psi$ is a primitive
character modulo conductor of $\chi$ and $\chi_{1}$ is the principal character
mod $n$. Then $\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\psi(kp^{m}+1)\chi_{1}(kp^{m}+1)$,
where $\psi$ is the primitive character mod conductor of $\chi$ and $\chi_{1}$
is the principal character mod $p^{n}$. Since $s\leq m\leq l-s$,
$(kp^{m}+1,p^{n})=1$, using Lemma 2.6 and Lemma 3.1 we get

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\chi(kp^{m}+1)$
$\displaystyle=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{n-m})_{s}=1\end{subarray}}^{p^{n-m}}\psi(kp^{m}+1)$
$\displaystyle=\frac{\Phi_{s}(p^{n-m})}{\Phi_{s}(p^{l-m})}\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{l-m})_{s}=1\end{subarray}}^{p^{l-m}}\psi(kp^{m}+1)$
$\displaystyle=p^{n-l}\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{l-m})_{s}=1\end{subarray}}^{p^{l-m}}\psi(kp^{m}+1)$
$\displaystyle=\begin{cases}-p^{n-l}\text{ if }m=l-s\\\ 0\text{ if }s\leq
m<l-s,\end{cases}$ $\displaystyle\text{which completes the proof}.$

∎

Next we prove a lemma, which is key to the proof of Theorem 1.2.

######  Lemma 3.3.

Let $s,a\in N$ and $\chi$ be a Dirichlet character mod $p^{a}$, where $a=qs$
for some $q\in\mathbb{N}$. If $p^{rs}$ is the conductor of $\chi$ where
$r\in\mathbb{N}$ and $1\leq r\leq q$ , we have
$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}=1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi(k)=(q-r+1)\Phi_{s}(p^{a}).$

###### Proof.

We prove the lemma case by case.
Case $1$. $r=1$
In this case $p^{s}$ is the conductor of $\chi$. From the proof of Theorem
1.1, we have
$f(p^{a})=(p^{a}-1)+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)$. Using
Lemma 3.2,

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p^{a})_{s}=1\end{subarray}}^{p^{a}}(k-1,p^{a})_{s}\chi(k)$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\Phi_{s}(p^{a-ts})$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)p^{a-ts}(1-\frac{1}{p^{s}})$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{a}-p^{a-ts})(1-p^{-s})$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{a}-p^{a-s}-p^{a-ts}+p^{a-(t+1)s})$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{a}-p^{a-s})+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{a-(t+1)s}-p^{a-ts})$
$\displaystyle=p^{a}-1+(p^{a}-p^{a-s})(q-1)+(p^{a-qs}-p^{a-s})$
$\displaystyle=p^{a}-1+(p^{a}-p^{a-s})(q-1)+1-p^{a-s}$
$\displaystyle=q(p^{a}-p^{a-s})$ $\displaystyle=q\Phi_{s}(p^{a})$

Case $2$. $r=q$
In this case $\chi$ is the primitive character mod $p^{a}$. The claim
immediately follows from Theorem 1.1.
Case $3$. $2\leq r\leq q-1$
As in the first case we have

$f(p^{a})=(p^{a}-1)+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1).$

By Lemma 3.2, we get $\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi(jp^{ts}+1)=\begin{cases}\Phi_{s}(p^{a-ts}),\text{
if }r\leq t<q\\\ -p^{a-rs},\text{ if }t=r-1\\\ 0,\text{ if }1\leq
t<r-1.\end{cases}$ Now

$\displaystyle f(p^{a})$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(j,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi_{p^{a}}(jp^{ts}+1)$
$\displaystyle=p^{a}-1+\sum\limits_{\begin{subarray}{c}t=1\end{subarray}}^{r-2}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(k,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi(jp^{ts}+1)+(p^{(r-1)s}-1)(-p^{a-rs})$
$\displaystyle\text{
}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{ts}-1)\sum\limits_{\begin{subarray}{c}j=1\\\
(k,p^{a-ts})_{s}=1\end{subarray}}^{p^{a-ts}}\chi(jp^{ts}+1)$
$\displaystyle=p^{a}-1-(p^{rs-s}-1)p^{a-rs}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{ts}-1)\Phi_{s}(p^{a-ts})$
$\displaystyle=p^{a}-1-(p^{rs-s}-1)p^{a-rs}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{ts}-1)p^{a-ts}(1-\frac{1}{p^{s}})$
$\displaystyle=p^{a}-1-p^{a-s}+p^{a-rs}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{ts}-1)p^{a-ts}(1-p^{-s})$
$\displaystyle=p^{a}-1-p^{a-s}+p^{a-rs}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{a}-p^{a-s}-p^{a-ts}+p^{a-(t+1)s})$
$\displaystyle=p^{a}-1-p^{a-s}+p^{a-rs}+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{a}-p^{a-s})+\sum\limits_{\begin{subarray}{c}t=r\end{subarray}}^{q-1}(p^{a-(t+1)s}-p^{a-ts})$
$\displaystyle=p^{a}-1-p^{a-s}+p^{a-rs}+(p^{a}-p^{a-s})(q-r)+p^{a-qs}-p^{a-rs}$
$\displaystyle=p^{a}-1-p^{a-s}+(p^{a}-p^{a-s})(q-r)+1$
$\displaystyle=(q-r+1)(p^{a}-p^{a-s})$ $\displaystyle=(q-r+1)\Phi_{s}(p^{a}).$

∎

######  Remark 3.4.

Lemma 3.4 is very much similar to [16, Lemma 3.1]. The identity in [16, Lemma
3.1] reduces to the Menon’s identity when $\chi$ is a principal character. But
because of the assumptions in the lemma above, $\chi$ cannot be taken as the
principal character and so this lemma cannot be strictly taken as a
generalization of [16, Lemma 3.1].

Finally we prove Theorem 1.2, which is similar to Theorem 1.2 in [16]. But our
conditions are more restrictive than those appearing in [16, Theorem 1.2].

###### Proof of Theorem 1.2.

We use the fact that if $n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{r}^{a_{r}}$
then
$\chi_{n}=\chi_{p_{1}^{a_{1}}}\chi_{p_{2}^{a_{2}}}\cdots\chi_{p_{r}^{a_{r}}}$,
where $\chi_{n}$ is the Dirichlet character mod $n$. Also if $g(\chi)$ denotes
the conductor of $\chi$, then
$g(\chi_{n})=g(\chi_{p_{1}^{a_{1}}})g(\chi_{p_{2}^{a_{2}}})\cdots
g(\chi_{p_{r}^{a_{r}}})$. Let $n=p_{1}^{a_{1}s}p_{2}^{a_{2}s}\cdots
p_{r}^{a_{r}s}$, $d=p_{1}^{b_{1}s}p_{2}^{b_{2}s}\cdots p_{r}^{b_{r}s}$ where
$1\leq b_{i}\leq a_{i}$. Now $f(n)=\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi_{n}(k)$ is multiplicative.
Therefore

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi(k)$ $\displaystyle=f(n)$
$\displaystyle=f(p_{1}^{a_{1}s})f(p_{2}^{a_{2}s})\cdots f(p_{r}^{a_{r}s})$
$\displaystyle=\prod\limits_{\begin{subarray}{c}i=1\end{subarray}}^{r}f(p_{i}^{a_{i}s})$
$\displaystyle=\prod\limits_{\begin{subarray}{c}i=1\end{subarray}}^{r}\sum\limits_{\begin{subarray}{c}k=1\\\
(k,p_{i}^{a_{i}s})_{s}=1\end{subarray}}^{p_{i}^{a_{i}s}}(k-1,p_{i}^{a_{i}s})_{s}\chi_{p_{i}^{a_{i}s}}(k)$

Note that $p_{1}^{b_{1}s}p_{2}^{b_{2}s}\cdots
p_{r}^{b_{r}s}=g(\chi_{p_{1}^{a_{1}s}})g(\chi_{p_{2}^{a_{2}s}})\cdots
g(\chi_{p_{r}^{a_{r}s}})$. It is clear that
$g(\chi_{p_{i}^{a_{i}s}})=p_{i}^{b_{i}s}$. Hence by Lemma 3.3 ,

$\displaystyle\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi(k)$
$\displaystyle=\prod\limits_{\begin{subarray}{c}i=1\end{subarray}}^{r}(a_{i}-b_{i}+1)\Phi_{s}(p_{i}^{a_{i}s})$
$\displaystyle=\prod\limits_{\begin{subarray}{c}i=1\end{subarray}}^{r}\tau_{s}(p_{i}^{(a_{i}-b_{i})s})\Phi_{s}(p_{i}^{a_{i}s})$
$\displaystyle=\Phi_{s}(n)\tau_{s}(\frac{n}{d}),$ which completes the proof.

∎

######  Remark 3.5.

A strict generalization of Theorem 1.2 in [16] would have been
$\sum\limits_{\begin{subarray}{c}k=1\\\
(k,n)_{s}=1\end{subarray}}^{n}(k-1,n)_{s}\chi(k)=\Phi_{s}(n)\tau_{s}(n/d)$,
where $\chi$ is a Dirichlet character mod $n$ with conductor $d$. But this
identity cannot be derived. For example, if we take $q=1$, $s=2$, $r=0$ and
$p=2$, the LHS of this identity evaluates to $(0,4)_{2}+(2,4)_{2}=5$ where as
the RHS gives $6$.

In [14], Tóth derived an identity similar to Menon’s identity involving even
functions mod $n$, Möbius function and the Euler totient function. Note that
an arithmetical function is $n$-even if $f(k)=f((k,n))$. A concept similar to
$n$-even function is $(n,s)$-even functions defined by McCarthy. An
arithmetical function $f$ is $(n,s)$-even if $f(k)=f((k,n^{s})_{s})$ (see [8]
for details). Many of the properties of such functions were studied in [10].
We feel that Tóth’s results can be generalized to $(n,s)$-even functions and
similar identities can be derived if one uses the results appearing in [10].

##  4 Acknowledgements

The first author thanks the University Grants Commission of India for
providing financial support for carrying out research work through their
Junior Research Fellowship (JRF) scheme. The third author thanks the Kerala
State Council for Science,Technology and Environment, Thiruvananthapuram,
Kerala, India for providing financial support for carrying out research work.

## References

  * [1] Tom Apostol.  Introduction to Analytic Number Theory.  Springer, 1976.
  * [2] Arya Chandran, Neha Elizabeth Thomas, and K Vishnu Namboothiri.  A Menon-type identity using Klee’s function.  arXiv preprint arXiv:1912.12850, 2020.
  * [3] Eckford Cohen.  Some totient functions.  Duke Mathematical Journal, 23(4):515–522, 1956.
  * [4] Pentti Haukkanen.  Menon’s identity with respect to a generalized divisibility relation.  Aequationes Mathematicae, 70(3):240–246, 2005.
  * [5] Pentti Haukkanen and László Tóth.  Menon-type identities again: Note on a paper by Li, Kim and Qiao.  Publicationes Mathematicae: Debrecen, 96:487–502, 2020.
  * [6] Pentti Haukkanen and Jun Wang.  A generalization of Menon’s identity with respect to a set of polynomials.  Portugaliae Mathematica, 53(3):331–338, 1996.
  * [7] VL Klee.  A generalization of Euler’s $\varphi$-function.  The American Mathematical Monthly, 55(6):358–359, 1948.
  * [8] Paul J McCarthy.  The generation of arithmetical identities.  J. Reine Angew. Math, 203:55–63, 1960.
  * [9] P Kesava Menon.  On the sum $\sum(a-1,n),[(a,n)=1]$.  The Journal of the Indian Mathematical Society, 29(3):155–163, 1965\.
  * [10] K Vishnu Namboothiri.  The discrete Fourier transform of (r, s)-even functions.  Indian Journal of Pure and Applied Mathematics, 50(1):253–268, 2019\.
  * [11] V Sita Ramaiah.  Arithmetical sums in regular convolutions.  J. Reine Angew. Math, 303(304):265–283, 1978.
  * [12] Balasubramanian Sury.  Some number-theoretic identities from group actions.  Rendiconti del Circolo Matematico di Palermo, 58(1):99–108, 2009\.
  * [13] László Tóth.  Menon’s identity and arithmetical sums representing functions of several variables.  Rend. Sem. Mat. Univ. Politec. Torino, 69(1): 97–110, 2011.
  * [14] László Tóth.  Menon-type identities concerning Dirichlet characters.  International Journal of Number Theory, 14(04):1047–1054, 2018\.
  * [15] László Tóth.  Short proof and generalization of a Menon-type identity by Li, Hu and Kim.  Taiwanese Journal of Mathematics, 23(3):557–561, 2019.
  * [16] Xiao-Peng Zhao and Zhen-Fu Cao.  Another generalization of Menon’s identity.  International Journal of Number Theory, 13(9):2373–2379, 2017.