<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}

\DeclareMathOperator{\lcm}{lcm}
\def\l({\left(}
\def\r){\right)}
\DeclareMathOperator{\Log}{Log}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}




\begin{center}
\vskip 1cm{\Large\bf Sums of Products of  Generalized Ramanujan Sums}
\vskip 1cm
\large
Soichi Ikeda\\
Department of Mathematics\\
Shibaura Institute of Technology\\
307 Fukasaku, Minuma-ku, Saitama 337-8570\\
Japan\\
\href{mailto:sikeda@sic.shibaura-it.ac.jp}{\tt sikeda@sic.shibaura-it.ac.jp}\\
\ \\
Isao Kiuchi\\
Department of Mathematical Sciences\\
Faculty of Science\\
Yamaguchi University\\
Yoshida 1677-1 Yamaguchi 753-8512\\
Japan\\
\href{mailto:kiuchi@yamaguchi-u.ac.jp}{\tt kiuchi@yamaguchi-u.ac.jp}\\
\ \\
Kaneaki Matsuoka\\
Graduate School of Mathematics\\
Nagoya University\\
Furocho Chikusaku Nagoya 464-8602\\
Japan\\
\href{mailto:m10041v@math.nagoya-u.ac.jp}{\tt m10041v@math.nagoya-u.ac.jp}\\
\end{center}

\vskip .2 in

\begin{abstract} 
We consider weighted averages for the products   
$
t_{k_1}^{(1)}(j)\cdots t_{k_n}^{(n)}(j)
$
of  generalized Ramanujan sums 
$
t_{k_i}^{(i)}(j)=\sum_{d|\gcd(k_{i},j)}f_{i}(d)g_{i} ({k_i}/{d})h_{i}({j}/{d})
$
with any arithmetical functions 
$
f_{i}, g_{i}$ and $h_{i}
$ \ 
$
(i=1, \ldots, n),\ 
$  
 and derive formulas for several weighted averages with weights 
concerning completely multiplicative functions, completely additive functions, and others. 
\end{abstract}



\section{Introduction}
Let $\gcd(k,j)$ be the greatest common divisor of the positive integer $k$ and the integer $j$, and let 
$K=\lcm(k_{1},\ldots, k_{n})$ be the least common multiple of $n$-tuple  positive integers $k_{1},\ldots, k_{n}$.
The function $c_{k}(j)$, as usual, denotes 
the Ramanujan sum defined as the sum of the $m$-th powers of the primitive $k$-th roots of unity, 
namely, 
$$
c_{k}(j) = \sum_{1\leq m \leq k \atop \gcd(m,k)=1}^{} {\rm{exp}}\biggl(2\pi i \frac{{mj}}{k} \biggr),
$$
which can be expressed as the well-known identity
$$
\sum_{d|\gcd(k,j)} d\mu \biggl(\frac{k}{d}\biggr)
$$
with the M\"{o}bius function $\mu$. 
Anderson and Apostol \cite{AA} (also see \cite{A, Ap, M, S})   
 first introduced the sum
$$
s_{k}(j)=\sum_{d|\gcd(k,j)}f(d)g\l(\frac{k}{d}\r)
$$ 
with any arithmetical functions $f$ and $g$, which is a generalization of Ramanujan's sum. 
This function is said to be the  Anderson--Apostol sum. 
Now, let $f$ be a completely multiplicative function, and let $g(k)=\mu(k)u(k)$ with $u$ a multiplicative function. 
Assume that $f(p)\neq 0$ and $f(p)\neq u(p)$ for all primes $p$, and let 
$                                                         
F(k) = (f*g)(k).
$           
Anderson and Apostol \cite{AA} derived the identity
$
s_{k}(j)=
{\displaystyle F(k)\mu\l(m\r)u\l(m\r)}/{\displaystyle F\l(m\r)} 
$ 
with $m=k/\gcd(k,j)$. This is said to be  {\it H\"{o}lder's identity } for $s_{k}(j)$, 
which has been considered 
by many mathematicians and physicists. 
For any fixed positive integer $r$, using the properties of the sum 
\begin{align}                                                                                                        \label{Alkan}
\sum_{j=1}^{k}j^{r}c_{k}(j),
\end{align} 
Alkan \cite{A3, A4} derived exact formulas involving Euler's and Jordan's functions for averages of the special values of 
$L$-functions.  T\'{o}th \cite{To1} showed a simpler proof of (\ref{Alkan}) and established 
some identities for other weighted averages of Ramanujan's sum with weights concerning logarithms, 
values of arithmetic functions for gcd's, the gamma function, 
the Bernoulli polynomials, and binomial coefficients. 
In a recent paper,  Kiuchi,  Minamide and  Ueda \cite{KMU} gave a generalization of some identities due to  T\'{o}th 
\cite{To1}; they showed that 
\begin{align}
&amp;\frac{1}{k^r}\sum_{j=1}^{k}j^{r} s_{k}(j) 
=\frac{1}{2} (f*g)(k) 
 + \frac{1}{r+1} \sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m} B_{2m} (f*{\rm{id}}_{1-2m}\cdot g)(k)            \label{KMU1}  
\end{align}
for any fixed positive integer $r$,  
\begin{align} 
&amp;\sum_{j=1}^{k} s_{k}(j) \log j
= (f\cdot \log * g\cdot {\rm{id}})(k) + (f*g\cdot \Log) (k),                                                  \label{KMU2} \\
&amp;\sum_{j=1}^{k}  s_{k}(j) \log \Gamma \l(\frac{j}{k}\r)
=\log\sqrt{2\pi} \left\{ (f*g\cdot {\rm{id}})(k) - (f*g)(k)\right\}    
  - \frac12 (f*g\cdot \log)(k),                                                                                   \label{KMU3}  \\  
&amp;\frac{1}{2^k}\sum_{j=0}^{k} {k \choose j}  s_{k}(j) 
=\sum_{d|k}\frac{f(d)}{d}g\l(\frac{k}{d}\r) \sum_{l=1}^{d} (-1)^{\frac{lk}{d}} \cos^{k} \frac{l\pi}{d}             \label{KMU4}
\end{align}
and 
\begin{align}                                                                                                       \label{KMU5}
&amp;\sum_{j=0}^{k-1}B_{m}\l(\frac{j}{k}\r) s_{k}(j) 
= \frac{B_m}{k^{k-1}} ({\rm{id}}_{m-1}\cdot f *g)(k), 
\end{align}
where the function $\Log d$ is given by $\log (d!)$ and $\Gamma$ denotes the gamma function. 
Here, $B_{m}(x)$ \cite{Ap} (also see \cite{Coh, Com}) denotes the Bernoulli polynomials defined by the expansion 
$$
\frac{ze^{xz}}{e^{z}-1}=\sum_{m=0}^{\infty}B_{m}(x)\frac{z^m}{m!} 
$$
where $|z|&lt;2\pi$. The number $B_m $ is the Bernoulli number given by $B_{m}(0)$. 
The expressions in (\ref{KMU1})--(\ref{KMU5}) give a generalization of some interesting identities by  T\'{o}th \cite{L} 
and  Alkan \cite{A3, A1, A4, A2}.
The function 
\begin{align}                                                                                                                   \label{E}
E(k_{1},\ldots,k_{n})=\frac{1}{K}\sum_{j=1}^{K}c_{k_1}(j)\cdots  c_{k_n}(j)  
\end{align}   
of the product $c_{k_1}(j)\cdots c_{k_n}(j)$ of Ramanujan's sums for  $n$ variables
was investigated in the studies of  Liskovets \cite{L} and  T\'{o}th \cite{To2},
 which has some interesting formulas for combinatorial and topological applications.
The expression (\ref{E}) has been introduced by  Mednykh and  Nedela \cite{MN} to handle certain problems of 
enumerative combinatorics. 
They showed that 
all the values $E(k_1,\ldots, k_n)$ are nonnegative integers. 
Furthermore,  T\'{o}th derived that two interesting representations 
\cite[Propositions 3 and 9]{To2}, \cite[Corollary 4]{To4}  for  $E$ hold:
\begin{align}
E(k_{1},\ldots,k_{n})&amp;=\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}}
\frac{d_{1}\cdots d_{n}}{\lcm(d_{1},\ldots,d_{n})}\mu\l(\frac{k_1}{d_1}\r)\cdots  \mu\l(\frac{k_n}{d_n}\r)              \label{E1}
\end{align}
and 
\begin{align}
E(k_{1},\ldots,k_{n})&amp;=\frac{1}{K} \sum_{d_{}|K}
c_{k_{1}}(d)\cdots c_{k_{n}}(d)\phi\l(\frac{K}{d}\r),                                                                              \label{E2}
\end{align}
where $\phi$ is the Euler  totient function. 
He also noted that all values for  $E$ are nonnegative integers and 
 that ${E}$ is multiplicative as a function of several variables.
Let $\widetilde{E}$ denote a generalization of ${E}$ defined by
\begin{align}                                                                                                                 \label{tildeE}
\widetilde{E}(k_{1},\ldots,k_{n})=\frac{1}{K}\sum_{j=1}^{K}s_{k_1}(j)\cdots  s_{k_n}(j).
\end{align}
Then  T\'{o}th \cite[Proposition 19]{To2} deduced that two formulas for  $\widetilde{E}$ hold: 
\begin{align}
\widetilde{E}(k_{1},\ldots,k_{n})&amp;=\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}}
\frac{f(d_{1})\cdots f(d_{n})}{\lcm(d_{1},\ldots,d_{n})}g\l(\frac{k_1}{d_1}\r)\cdots g\l(\frac{k_n}{d_n}\r)            \label{tildeE1}
\end{align}
and 
\begin{align}
\widetilde{E}(k_{1},\ldots,k_{n})&amp;=\frac{1}{K} \sum_{d_{}|K}
s_{k_{1}}(d)\cdots s_{k_{n}}(d)\phi\l(\frac{K}{d}\r).\label{tildeE2}
\end{align}
He also showed that if $f$ and $g$ are multiplicative functions, then (\ref{tildeE}) is multiplicative as a function of several variables.
The weighted average of the products of Ramanujan's sum with 
weight concerning the function ${\rm{id}}_r$ for any fixed positive integer $r$ defined by
\begin{align}                                                                                                                    \label{S}
S_{r}(k_{1},\ldots,k_{n}) =\frac{1}{K^{r+1}}\sum_{j=1}^{K}j^{r}c_{k_1}(j)\cdots  c_{k_n}(j)
\end{align} 
 was considered by T\'{o}th \cite[Proposition 7]{To1}, who derived the following identity
\begin{align}                                                                                                                    \label{S_r}
&amp;S_{r}(k_{1},\ldots,k_{n}) 
 =\frac{\phi(k_1)\cdots \phi(k_n)}{2K}                                                              \\ 
&amp;+ \frac{1}{r+1} \sum_{m=0}^{\lfloor \frac{r}{2} \rfloor}{r+1 \choose 2m} \frac{B_{2m}}{K^{2m}}
\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} \frac{d_{1}\cdots d_{n}}{\lcm(d_{1},\ldots,d_{n})^{1-2m}}
\mu\l(\frac{k_1}{d_1}\r)\cdots  \mu\l(\frac{k_n}{d_n}\r).\nonumber
\end{align}
He presented a multivariable generalization of (\ref{Alkan}) connected to the orbicyclic arithmetic function, 
discussed by Liskovets \cite{L} and T\'{o}th \cite{To2}. 
Substituting $r=1$ in (\ref{S_r}),
it follows that 
$$ 
S_{1}(k_{1},\ldots,k_{n}) =\frac{\phi(k_1)\cdots \phi(k_n)}{2K} + \frac{E(k_{1},\ldots,k_{n})}{2},
$$ 
which was given by  T\'{o}th \cite[Corollary 2]{To1}. 


For any arithmetical functions $f_{i}$, $g_{i}$ and  $h_{i}\ (i=1,2,\ldots, n)$, we define 
 $s_{k_i}^{(i)}(j)$ and $t_{k_i}^{(i)}(j)$ by
$$ 
s_{k_i}^{(i)}(j) = \sum_{d|\gcd(k_{i},j)}f_{i}(d)g_{i}\l(\frac{k_i}{d}\r)
\quad 
{\rm{and}} 
\quad 
t_{k_i}^{(i)}(j) = \sum_{d|\gcd(k_{i},j)}f_{i}(d)g_{i}\l(\frac{k_{i}}{d}\r)h_{i}\l(\frac{j}{d}\r),      
$$ 
respectively.

The first aim of this study is to derive some identities for weighted averages of 
the product $t_{k_1}^{(1)}(j)\cdots t_{k_n}^{(n)}(j)$ 
 with weight function $w_{r}$, completely multiplicative, completely additive, and others, for any fixed positive integer $r$, namely 
\begin{align}
U_{r}(k_{1},\ldots, k_{n}) = \sum_{j=1}^{K}w_{r}^{}(j)t_{k_1}^{(1)}(j) \cdots t_{k_n}^{(n)}(j).
\label{U}  
\end{align}
This sum is a generalization of some of the identities for weighted averages mentioned by  Alkan \cite{A1},  Liskovets \cite{L}, 
  T\'{o}th \cite{To1, To2} and  Kiuchi,  Minamide and  Ueda \cite{KMU}. 
 To our knowledge, we derive some new and useful formulas in Theorems \ref{th_main1}, \ref{th_main2} and \ref{th_main3}.
This study then aims to establish some identities for the weighted averages 
of the product $s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)$ 
with weights concerning the gamma function, binomial coefficients, and Bernoulli polynomials, 
which provide a generalization of some interesting identities 
discussed by  T\'{o}th  \cite{To1}  and  Kiuchi,  Minamide and  Ueda \cite{KMU}.

\medskip 


\noindent{\bf Notations}.\ \ We use the following notation throughout this paper. 
For any positive integer $n$, the functions ${\rm{id}}$ and ${\rm{id}}_{q}$ as well as
the unit function ${\bf 1}$ are given by 
${\rm{id}}(n)=n$, \ ${\rm{id}}_{q}(n)=n^{q}$ for any real number $q$ and ${\bf 1}(n)=1$, respectively. 
The symbols $*$ and $\cdot$ denote the Dirichlet convolution and the ordinary product of arithmetical functions, respectively.
The function  $\phi_{s}(n)$  defines   the Jordan function   by  $({\rm{id}}_{s}*\mu)(n)$ for any real number  $s$.



\section{Some formulas for $U_{r}(k_{1},\ldots, k_{n})$}
We shall evaluate the function $U_{r}(k_{1},\ldots,k_{n})$. 
The weight function $w_{r}$ of $U_{r}(k_{1},\ldots,k_{n})$ only deals with completely multiplicative functions and 
completely additive functions, and 
we introduce a simple proof of (\ref{U}) and some useful formulas in Theorems \ref{th_main1} and \ref{th_main2}. 
Moreover, we shall derive some identities of the weighted averages of the product $s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)$
with weights concerning the gamma function, binomial coefficients, and the Bernoulli polynomials.

\begin{theorem} \label{th_main1}
Let $f_1,\ldots, f_n$,\ $g_1, \ldots, g_n$, and $h_1, \ldots, h_n$ denote any arithmetical functions, and let
\begin{align*}
&amp;U_{r}(k_{1},\ldots, k_{n}) \\
&amp;= \sum_{j=1}^{K}w_{r}^{}(j)  \sum_{d_{1}|\gcd(k_{1},j)}f_{1}(d_1)g_{1}\l(\frac{k_{1}}{d_1}\r)h_{1}\l(\frac{j}{d_1}\r) \cdots 
                           \sum_{d_{n}|\gcd(k_{n},j)}f_{n}(d_n)g_{n}\l(\frac{k_{n}}{d_n}\r)h_{n}\l(\frac{j}{d_n}\r).   
\end{align*}
If $w_{r}$ is a completely multiplicative function, we have 
\begin{align}                                                                                                          \label{th2.1}
&amp;U_{r}(k_{1},\ldots,k_{n})  \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})g_{1}\l(\frac{k_1}{d_1}\r)\cdots f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r)
w_{r}(\lcm(d_{1},\ldots,d_{n}))                    \times                                                            \nonumber    \\           
&amp; \qquad    \times   \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}w_{r}(l) 
 h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r),              \nonumber   
\end{align}
 and if in addition, $h_1, \ldots, h_n $ are completely multiplicative functions, then
\begin{align}                                                                                                         \label{th2.1cm}
&amp;U_{r}(k_{1}, \ldots, k_{n})  \\
&amp; = \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_{1}) g_{1}\l(\frac{k_1}{d_1}\r) h_{1}\l(\frac{\lcm(d_1, \ldots, d_n)}{d_1} \r) 
\cdots 
f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r)    \times    \nonumber \\
&amp;  \times  h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} \r)w_{r}\l(\lcm(d_{1},\ldots,d_{n})\r)
\sum_{l=1}^{\frac{K}{\lcm(d_{1}, \ldots, d_{n})}}w_{r}(l) h_{1}\l(l\r)\cdots h_{n}\l(l\r).      \nonumber     
\end{align}
 If $w_{r}$ is a completely additive function,  we have 
\begin{align}                                                                                                           \label{th2.2}
&amp;U_{r}(k_{1},\ldots,k_{n}) \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})g_{1}\l(\frac{k_1}{d_1}\r)\cdots f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r)
w_{r}(\lcm(d_{1},\ldots,d_{n}))   \times                                                            \nonumber    \\
&amp;    \qquad  \qquad    \times   \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}
h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r)\nonumber \\
&amp;+\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})g_{1}\l(\frac{k_1}{d_1}\r)\cdots f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r) \times \nonumber \\
&amp;    \qquad  \qquad    \times
\sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}w_{r}(l)
h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r), \nonumber
\end{align}
 and if in addition, $h_1, \ldots, h_n $ are completely multiplicative functions, then 
\begin{align}                                                                                                        \label{th2.2cm}
&amp; U_{r}(k_{1},\ldots,k_{n}) \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})g_{1}\l(\frac{k_1}{d_1}\r)h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1}\r)\cdots 
f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r)  h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n}\r) \times   \nonumber \\
&amp;\qquad  \times   w_{r}(\lcm(d_{1},\ldots,d_{n}))  
\sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}h_{1}\l(l\r)\cdots h_{n}\l( l\r) \nonumber \\
&amp;+\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})g_{1}\l(\frac{k_1}{d_1}\r)h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} \r)\cdots 
 f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r) h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} \r)  \times \nonumber \\
&amp; \qquad \times 
\sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}w_{r}(l)
h_{1}\l( l\r)\cdots h_{n}\l( l\r).                  \nonumber
\end{align}
\end{theorem}


\begin{remark}
The formulas (\ref{th2.1}) and (\ref{th2.1cm}) 
 immediately imply a generalization of the two formulas (\ref{E1}) and (\ref{tildeE1}). 
We substitute $w_r={\bf 1}$, $f_{1}=\cdots =f_{n}=f$, $g_{1}=\cdots =g_{n}=g$, and $h_{1}=\cdots =h_{n}={\bf 1}$ 
in (\ref{th2.1}) to obtain the formula (\ref{tildeE1}). 
\end{remark}


The formulas (\ref{th2.1})--(\ref{th2.2cm}) give an analogue and a generalization of result of T\'{o}th \cite[Proposition 1]{To5}. 
 For any positive integer $k$,  Kiuchi,  Minamide and  Ueda \cite{KMU} recently showed that 
if  $w_r$ is a completely multiplicative function, then the identity 
\begin{align}                                                                                                          \label{KMUcm}
  \sum_{j=1}^{k}w_{r}(j)t_{k}(j) = (f\cdot w_r *g\cdot W)(k)
\end{align}
holds with $W(d)=\sum_{m=1}^{d}w_{r}(m)h(m)$, and 
if $w_r$ is a completely additive function, then the identity 
\begin{align}                                                                                                          \label{KMUca}
  \sum_{j=1}^{k}w_{r}(j)t_{k}(j) = (f\cdot w_r *g\cdot H)(k) + (f* g\cdot W)(k)
\end{align}
holds with $H(d)=\sum_{m=1}^{d}h(m)$. 
Thus, the formulas (\ref{th2.1}) and (\ref{th2.2}) give a generalization of (\ref{KMUcm}) and (\ref{KMUca}), respectively. 
Substituting $ w_r ={\rm{id}}_{r}$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.1cm}),  
       $ w_r ={\rm{id}}_{r}$ and $g_{1}=\cdots =g_{n}={\bf 1}$ in (\ref{th2.1}), and  
       $ w_r ={\rm{id}}_{r}$ and $f_{1}=\cdots =f_{1} ={\bf 1}$ in (\ref{th2.1}), 
 we derive the following formulas (\ref{Cor2.11}), (\ref{Cor2.12}), and (\ref{Cor2.13}), respectively. 

\begin{corollary}  \label{cor1}
Let the notation be as above. Then we have 
\begin{align}                                                                                                          \label{Cor2.11}
&amp;\frac{1}{K^{r+1}}\sum_{j=1}^{K}j^{r}s_{k_{1}}^{(1)}(j) \cdots s_{k_n}^{(n)}(j) \\
&amp;=\frac{1}{2K} (f_{1}*g_{1})(k_1)\cdots (f_{n}*g_{n})(k_n)                      \nonumber \\  
&amp; +\frac{1}{r+1}\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}\frac{B_{2m}}{K^{2m}}
\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}}\frac{f_{1}(d_1)\cdots f_{n}(d_n)}{\lcm(d_{1},\ldots,d_{n})^{1-2m}}    
g_{1}\l(\frac{k_1}{d_1}\r)\cdots g_{n}\l(\frac{k_n}{d_n}\r),                                                     \nonumber 
\end{align}
\begin{align} 
&amp; \sum_{j=1}^{K}j^{r}\sum_{d_{1}|\gcd(k_{1},j)}f_{1}(d_1)h_{1}\l(\frac{j}{d_1}\r)\cdots 
 \sum_{d_{n}|\gcd(k_{n},j)}f_{n}(d_n)h_{n}\l(\frac{j}{d_n}\r)                                                              \label{Cor2.12}      \\
&amp;=\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_1)\cdots f_{n}(d_n) \lcm(d_{1},\ldots,d_{n})^{r}  \times  \notag \\
&amp;\qquad \times \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}} l^{r}
h_{1}\l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_1}l\r)\cdots h_{n}\l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_n}l\r) \nonumber
\end{align}
and 
\begin{align}                                                                                                           \label{Cor2.13}
&amp; \sum_{j=1}^{K}j^{r}\sum_{d_{1}|\gcd(k_{1},j)}g_{1}\l(\frac{k_1}{d_1}\r)h_{1}\l(\frac{j}{d_1}\r)\cdots 
                    \sum_{d_{n}|\gcd(k_{n},j)}g_{n}\l(\frac{k_n}{d_n}\r)h_{n}\l(\frac{j}{d_n}\r)\\
&amp;=\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}g_{1}\l(\frac{k_1}{d_1}\r)\cdots g_{n}\l(\frac{k_n}{d_n}\r) \lcm(d_{1},\ldots,d_{n})^{r}  \times \notag \\
&amp;\qquad \times \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}} l^{r}h_{1}
  \l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_1}l\r)\cdots h_{n}\l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_n}l\r).                       \nonumber
\end{align}
\end{corollary}



The formula (\ref{Cor2.11}) also gives a generalization of the formula (\ref{KMU1}). 
As an application of Corollary \ref{cor1}, 
we give some formulas for weighted averages of the products of the arithmetical functions of Anderson--Apostol sums. 

\begin{example}  \label{ex_th_main1}
Let the notation be as above. Then we have  
\begin{align}                                                                                                       \label{Cor2.111}
&amp;\frac{1}{K^{r+1}}\sum_{j=1}^{K}j^{r}\gcd(k_{1},j)  \cdots \gcd(k_{n},j) \\
&amp; =\frac{k_1 k_2   \cdots  k_n}{2K}                                                                                                     
  +\frac{1}{r+1}\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}\frac{B_{2m}}{K^{2m}}
\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}}\frac{\phi(d_1)\cdots \phi(d_n)}{\lcm(d_{1},\ldots,d_{n})^{1-2m}},                     \nonumber \\
\end{align}
\begin{align}
&amp;\frac{1}{K^{2r}}\sum_{j=1}^{K}j^{2r}
 \sum_{d_{1}|\gcd(k_{1},j)}\frac{\phi(d_1)}{d_1} \cdots \sum_{d_{1}|(k_{r},j)}\frac{\phi(d_r)}{d_r}    \label{Cor2.121}   \\ 
&amp;=\frac{1}{2} \sum_{d_1 |k_1, \ldots, d_r|k_r} \frac{\phi(d_1)\cdots \phi(d_r)}{d_{1}\cdots d_{r}}          \nonumber    \\ 
&amp;  + \frac{K}{2r+1} \sum_{m=0}^{r}{2r+1 \choose 2m}\frac{B_{2m}}{K^{2m}} 
\sum_{d_{1}|k_{1}, \ldots, d_{r}|k_{r}}\frac{\phi(d_1)}{d_1} \cdots \frac{\phi(d_r)}{d_{r}} 
\lcm(d_1, \ldots, d_r)^{2m-1},  \nonumber
\end{align}
\begin{align}
&amp;\frac{1}{K^{r+n+1}}\sum_{j=1}^{K}j^{r+n}
\sum_{d_{1}|\gcd(k_{1},j)}\frac{f_{1}(d_1)}{d_1} \cdots \sum_{d_{n}|(k_{n},j)}\frac{f_{n}(d_n)}{d_n}    \label{Ex2.11}  \\
&amp;=\frac{1}{2K}\sum_{d_{1}|k_{1}}\frac{f_{1}(d_1)}{d_1} \cdots \sum_{d_{n}|k_{n}}\frac{f_{n}(d_1)}{d_n}     \nonumber \\
&amp;+ \frac{1}{r+n+1}  \sum_{m=0}^{\lfloor \frac{r+n}{2} \rfloor} {r+n+1 \choose 2m} \frac{B_{2m}}{K^{2m}}  
\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}} f_{1}\l(d_1\r) \cdots f_{n}\l(d_n\r)
 \frac{\lcm(d_{1},\ldots,d_{n})^{2m-1}}{d_{1} \cdots d_{n}},                                                    \nonumber 
\end{align}
and 
\begin{align}                                                                                                  \label{Ex2.12}
&amp;  \frac{1}{K^{r+n+1}} \sum_{j=1}^{K}j^{r+n}
\sum_{d_{1}|\gcd(k_{1},j)}g_{1}\l(\frac{k_1}{d_1}\r)\frac{1}{d_1} \cdots \sum_{d_{n}|\gcd(k_{n},j)}g_{n}\l(\frac{k_n}{d_n}\r)\frac{1}{d_n}     \\
&amp;=\frac{1}{2K}\l(g_1 *\frac{1}{\rm{id}}\r)(k_1) \cdots  \l(g_n *\frac{1}{\rm{id}}\r)(k_n)    \nonumber \\
&amp;   + \frac{1}{r+n+1}  \sum_{m=0}^{\lfloor \frac{r+n}{2} \rfloor} {r+n+1 \choose 2m} \frac{B_{2m}}{K^{2m}}  
  \sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}} g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r) 
\frac{\lcm(d_{1},\ldots,d_{n})^{2m-1}}{d_{1} \cdots d_{n}}.                                                      \nonumber
\end{align}
\end{example}

 
We substitute $f_{1}=\cdots =f_{n}=\phi$ and $g_{1}=\cdots =g_{n}={\bf 1}$ in (\ref{Cor2.11}) to obtain (\ref{Cor2.111}) 
using $(\phi* {\bf 1})(\gcd(k_i,j)) = \gcd(k_i,j) \ (i=1,\ldots, n)$. 
The formula (\ref{Cor2.111}) is an analogue of the identity  
\begin{align}                                                                                                           \label{gcd} 
\frac{1}{K}\sum_{j=1}^{K}\gcd(k_{1},j)  \cdots \gcd(k_{n},j) 
&amp;= \sum_{d_1 |k_1, \ldots, d_n |k_n} \frac{\phi(d_1)\cdots \phi(d_n)}{\lcm(d_1,\ldots,d_n)}  
\end{align}
\cite[Proposition 12]{To2}, \cite[Corollary 2]{To3}. 
The formula (\ref{gcd}) was mentioned by  Liskovets \cite{L}, and it was considered by
Deitmar,  Koyama and  Kurokawa \cite{DKK} 
in a special case, investigating analytic properties of Igusa-type zeta-functions. 
Using the arguments of elementary probability theory,  
the explicit formula for the values of (\ref{gcd}) derived in \cite{DKK} was 
re-proved by Minami \cite{Mi} for the general case $m_{1},\ldots, m_{n}$. 
 We substitute $n=r$, $f_{1}=\cdots =f_{n}=\phi$ and $h_{1}=\cdots =h_{n}= {\rm{id}}$ 
 in (\ref{Cor2.12}) and use (\ref{m^r}) below to obtain (\ref{Cor2.121}). 
The formulas (\ref{Cor2.12}) and (\ref{Cor2.13}) imply a generalization of 
two formulas derived in \cite{KMU}, namely 
$$
\frac{1}{k^r}\sum_{j=1}^{k}j^r \sum_{d|\gcd(k,j)}f(d)h\l(\frac{j}{d}\r) 
= \sum_{d|k}f\l(\frac{k}{d}\r)\frac{1}{d^r}\sum_{l=1}^{d}h(l)l^r
$$ 
and 
$$
  \frac{1}{k^r}\sum_{j=1}^{k} j^r \sum_{d|\gcd(k,j)}g\l(\frac{k}{d}\r) h\l(\frac{j}{d}\r) 
= \sum_{d|k} \frac{g(d)}{d^r}\sum_{l=1}^{d}h(l)l^r, 
$$  
which follow from (\ref{KMUcm}). 
Substituting  $h_{1}=\cdots =h_{n}={\rm{id}}$ in (\ref{Cor2.12}) and (\ref{Cor2.13}), respectively, 
and using (\ref{m^r}) below we easily obtain the two formulas (\ref{Ex2.11}) and (\ref{Ex2.12}). 


We shall evaluate some identities of weighted averages for the product $t_{k_1}^{(1)}\cdots t_{k_n}^{(n)}$ of 
 the weight $w_r$ with the completely additive function.  We set $w_r =\log$ and 
 substitute $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.2}), 
 $g_{1}=\cdots =g_{n}={\bf 1}$ in (\ref{th2.2}), and 
 $f_{1}=\cdots =f_{n}={\bf 1}$ in (\ref{th2.2}) 
to obtain the following formulas (\ref{Cor2.21}), (\ref{Cor2.22}), and (\ref{Cor2.23}), respectively.


\begin{corollary}  \label{cor2}
Let the notation be as above. Then we have 
\begin{align}                                                                                                                \label{Cor2.21}
&amp; \sum_{j=1}^{K}  s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j) \log j    \\
&amp;=K \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r)\cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
\frac{\log \lcm(d_{1},\ldots, d_{n})}{\lcm(d_{1},\ldots, d_{n})}                                                  \nonumber           \\
&amp; \quad   + \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r)\cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
\log \l(\frac{K}{\lcm(d_{1},\ldots, d_{n})}\r)!        \nonumber     
\end{align}
\begin{align}
&amp;\sum_{j=1}^{K} \log j   \sum_{d_{1}|\gcd(k_{1},j)}f_{1}(d_1)h_{1}\l(\frac{j}{d_1}\r) 
\cdots \sum_{d_{n}|\gcd(k_{n},j)}f_{n}(d_n)h_{n}\l(\frac{j}{d_n}\r)                                                              \label{Cor2.22}  \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})\cdots f_{n}(d_{n}) \log \lcm(d_{1},\ldots, d_{n})   \times  \nonumber \\
 &amp; \qquad    \times   \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}
h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r)                             \nonumber \\
&amp; + \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_{1})\cdots f_{n}(d_{n})    
\sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}  
  h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r) \log l               \nonumber  
\end{align}
and
\begin{align}                                                                                                                   \label{Cor2.23}
&amp;\sum_{j=1}^{K} \log j   \sum_{d_{1}|\gcd(k_{1},j)}g_{1}\l(\frac{k_1}{d_1}\r)h_{1}\l(\frac{j}{d_1}\r) \cdots 
\sum_{d_{n}|\gcd(k_{n},j)}g_{n}\l(\frac{k_n}{d_n}\r)h_{n}\l(\frac{j}{d_n}\r)                   \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}g_{1}\l(\frac{k_1}{d_1}\r)\cdots g_{n}\l(\frac{k_n}{d_n}\r)
 \log \lcm(d_{1},\ldots, d_{n})                                                               \times              \nonumber  \\ 
&amp;\qquad    \times   \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}
h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n}l\r)                     \nonumber  \\ 
&amp;+ \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}g_{1}\l(\frac{k_1}{d_1}\r)\cdots g_{n}\l(\frac{k_n}{d_n}\r) \times  \nonumber  \\     
&amp; \qquad \times  \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}
h_{1}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_1} l\r)\cdots h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} l\r) \log l.               \nonumber 
\end{align}
\end{corollary}


 (\ref{Cor2.21}) implies a generalization of (\ref{KMU2}).
 (\ref{Cor2.22}) and (\ref{Cor2.23}) give a generalization of the formulas
$$
\sum_{j=1}^{k}\log j \sum_{d|\gcd(k,j)}f(d)h\l(\frac{j}{d}\r) 
= (f\cdot \log * H)(k) +(f* I)(k),
$$
and 
$$
\sum_{j=1}^{k}\log j \sum_{d|\gcd(k,j)}g\l(\frac{k}{d}\r)h\l(\frac{j}{d}\r) 
= (\log  * g\cdot H)(k) +({\bf{1}}* g\cdot W)(k) 
$$
with
$I(d)=\sum_{l=1}^{d}h(l)l$, $H(d)=\sum_{m=1}^{d}h(m)$ and $W(d)=\sum_{m=1}^{d}w_{r}(m)h(m)$.
These two identities immediately follow from (\ref{KMUca}).


Next, we shall evaluate the function $U_{r}(k_{1},\ldots,k_{n})$,  which is another representation of (\ref{th2.1}) and (\ref{th2.2}).  
Using the method of  T\'{o}th \cite{To2}, we have the following formulas.  

\begin{theorem} \label{th_main2}
Let $k_{1},\ldots,k_{n}$ be any positive integers 
and let $K=\lcm(k_{1},\ldots,k_{n})$ be the least common multiple of $n$-tuple integers $k_{1},\ldots,k_{n}$. 
If $w_{r}$ is completely multiplicative function, then  
\begin{align}
U_{r}(k_{1},\ldots,k_{n})
&amp;= (w_{r}\cdot t_{k_1}^{(1)} \cdots t_{k_{n}}^{(n)}*W_r)(K)\label{th2.3cm}
\end{align} 
with 
$$
\displaystyle W_{r}(d)=\sum_{l=1\atop (l,d)=1}^{d}w_{r}(l),
$$
and if $w_{r}$ is a completely additive function, then 
\begin{align}                                                                                                         \label{th2.3ca}
U_{r}(k_{1},\ldots,k_{n})
&amp;= (w_{r}\cdot t_{k_1}^{(1)}\cdots t_{k_{n}}^{(n)}*\phi)(K) + (t_{k_1}^{(1)}\cdots t_{k_n}^{(n)}*W_{r})(K). 
\end{align} 
\end{theorem}


\begin{remark}  \label{rem2}
We substitute $w_r={\bf 1},\ f_{1}=\cdots =f_{n}= {\rm{id}},\ g_{1}=\cdots =g_{n}=\mu$\ 
and $h_{1}=\cdots =h_{n}={\bf 1}$ 
 in (\ref{th2.3cm}) to obtain (\ref{E2}), and   
$w_r={\bf 1}, f_{1}=\cdots =f_{n}=f, g_{1}=\cdots =g_{n}=g$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.3cm}) to obtain 
the formula (\ref{tildeE2}). The formulas (\ref{th2.3cm}) and (\ref{th2.3ca}) are an analogue of
(\ref{KMUcm}) and (\ref{KMUca}), respectively. 
\end{remark}


We substitute $w_{r}={\rm{id}}$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.3cm}) and use (\ref{lem4.11}) below 
to obtain the formula (\ref{Cor2.31}), which is a generalization of (\ref{S_r}). 
We also substitute  $w_r =\log$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.3ca}) and use (\ref{lem4.12}) below 
to obtain the formula (\ref{Cor2.32}). 


\begin{corollary}  \label{cor3}
Let the notation be as above. Then we have 
\begin{align}                                                                                                      \label{Cor2.31}
&amp;\frac{1}{K^{r}}\sum_{j=1 }^{K}j^{r} s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)   \\
&amp;= \frac{1}{2}s_{k_1}^{(1)}(K) \cdots s_{k_n}^{(n)}(K)                        
+\frac{1}{r+1}\sum_{d|K}  s_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r)
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}{B_{2m}}\phi_{1-2m}(d)  \nonumber 
\end{align}
and
\begin{align}                                                                                                     \label{Cor2.32}
&amp; \sum_{j=1 }^{K} s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)\log j      \\
&amp;=(s_{k_1}^{(1)}\cdots s_{k_n}^{(n)}\cdot \log *\phi)(K)  
 + \sum_{d|K}s_{k_1}^{(1)}\l(\frac{K}{d}\r) \cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r) \sum_{e|d}\mu(e) \Log \frac{d}{e}  \nonumber  \\
&amp;\qquad  - \sum_{d|K}s_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots s_{k_n}^{(n)}
\l(\frac{K}{d}\r)\phi(d) \sum_{p|d}\frac{\log p}{p-1}                                                                \nonumber
\end{align}
where $\Log d$  is given by $\log (d!)$.
\end{corollary}


As an application of Corollary \ref{cor3}, we provide two formulas for the weighted averages of 
the product $\gcd(k_{1},j)\gcd(k_{2},j)\cdots \gcd(k_{n},j)$ 
of the gcd's. 

\begin{example}  \label{ex_th_main2}
Let the notation be as above. Then  we have  
\begin{align}                                                                                                       \label{Cor2.311}
&amp;\frac{1}{K^{r}}\sum_{j=1}^{K}j^{r}\gcd(k_{1},j)  \cdots \gcd(k_{n},j) \\
&amp;= \frac{1}{2} \gcd(k_1,K) \cdots \gcd(k_n,K)   \nonumber  \\
&amp; + \frac{1}{r+1} \sum_{d|K} \gcd \l(k_1,\frac{K}{d}\r) \cdots \gcd \l(k_n,\frac{K}{d}\r) 
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m} B_{2m} \phi_{1-2m}(d),\nonumber
\end{align}
and
\begin{align}                                                                                                       \label{Cor2.321}
&amp;\sum_{j=1}^{K}\gcd(k_{1},j)  \cdots \gcd(k_{n},j) \log j  \\
&amp;= \sum_{d|K} \gcd \l(k_1,d\r) \cdots \gcd \l(k_n,d\r) (\log d) \phi\l(\frac{K}{d}\r)  \nonumber \\
&amp; +  \sum_{d|K} \gcd \l(k_1,\frac{K}{d}\r) \cdots \gcd \l(k_n,\frac{K}{d}\r) \sum_{e|d}\mu(e) {\rm{Log}} \frac{d}{e}   \nonumber  \\
&amp; -  \sum_{d|K} \gcd \l(k_1,\frac{K}{d}\r) \cdots \gcd \l(k_n,\frac{K}{d}\r)\phi(d)\sum_{p|d}\frac{\log p}{p-1}.          \nonumber
\end{align}
\end{example}

We substitute $w_r={\rm{id}}_{r}$,  $f_{1}=\cdots =f_{n}=\phi$ and $g_{1}=\cdots =g_{n}={\bf 1}$  in (\ref{Cor2.31}) 
to obtain (\ref{Cor2.311}), 
which is a generalization of T\'{o}th's result \cite[Proposition 14]{To2}: 
$$
\frac{1}{K}\sum_{j=1}^{K}\gcd(k_{1},j) \cdots \gcd(k_{n},j) 
= \frac{1}{K}\sum_{d|K} \gcd(d,k_1) \cdots \gcd(d,k_n) \phi\l(\frac{K}{d}\r). 
$$
We also substitute $w_r=\log $, $f_{1}=\cdots =f_{n}=\phi$ and $g_{1}=\cdots =g_{n}={\bf 1}$  in (\ref{Cor2.32}) to obtain 
(\ref{Cor2.321}). 


\smallskip 

Lastly,  we shall consider some weighted averages of 
the product $s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)$ with weights concerning the gamma function, 
 binomial coefficients, and Bernoulli polynomials. 
To state Theorem \ref{th_main3}, we use the well-known multiplication formula of 
Gauss--Legendre \cite[Proposition 9.6.33]{Coh} for the gamma function 
\begin{align}
  \prod_{j=1}^{n}\Gamma\l(\frac{j}{n}\r)&amp;=\frac{(2\pi)^{\frac{n-1}{2}}}{\sqrt{n}}\label{Gamma}
\end{align}
for any positive integer $n$, 
and the binomial formula \cite[(27)]{To5}
\begin{align}
\sum_{k=0}^{[n/r]}{n\choose kr} 
&amp;= \frac{1}{r}\sum_{j=1}^{r}\l(1+{\rm{exp}}\l(2\pi i\frac{j}{r}\r)\r)^{n}
= \frac{2^n}{r} \sum_{j=1}^{r}\cos^{n}\frac{j\pi}{r}\cos\frac{nj\pi}{r}                                    \label{Bino} 
\end{align}
for any positive integers $n$ and $r$. 
Furthermore, we use the well-known   formula for the Bernoulli polynomial \cite[Proposition 9.1.3]{Coh} 
\begin{align}
\sum_{j=0}^{k-1}B_{m}\l(\frac{j}{k}\r)&amp;=\frac{B_m}{k^{m-1}}\label{Ber}
\end{align}
for any positive integer $k$. 



 
\begin{theorem} \label{th_main3}
Let $k_{1},\ldots,k_{n}$ be any positive integers 
and let $K=\lcm(k_{1},\ldots,k_{n})$ be the least common multiple of $n$-tuple integers $k_{1},\ldots,k_{n}$. Then  we have 
\begin{align}                                                                                                               \label{th2.3Gamma}
&amp;\sum_{j=1}^{K} s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j) \log\Gamma\l(\frac{j}{K}\r)      \\
&amp;= K \log\sqrt{2\pi} \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}\frac{f_{1}(d_1) \cdots f_{n}(d_n)}{\lcm(d_1,\ldots, d_n)} 
g_{1}\l(\frac{k_1}{d_1}\r)\cdots  g_{n}\l(\frac{k_n}{d_n}\r)                                                   \nonumber  \\ 
 &amp;\quad    -  (f_1*g_1)(k_1) \cdots (f_n*g_n)(k_n)  \log\sqrt{2\pi K}                                    \nonumber        \\
&amp; \quad  +   \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \log \sqrt{\lcm(d_1,\ldots,d_n)}, \nonumber \\
&amp;  \sum_{j=0}^{K}{K \choose j} s_{k_1}^{(1)}(j) \cdots s_{k_n}^{(n)}(j)
\label{th2.3Bino}  \\  
&amp; = 2^{K} \sum_{d_1|k_1, \ldots, d_n|k_n} \frac{f_{1}(d_1)\cdots  f_{n}(d_n)}{\lcm(d_1,\ldots, d_n )} 
 g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r)  \times     \nonumber  \\                                           
&amp;\quad   \times    \sum_{l=1}^{\lcm(d_1, \ldots, d_n)} (-1)^{\frac{Kl}{\lcm(d_1, \ldots, d_n)}} \cos^{K}\frac{l\pi}{\lcm(d_1, \ldots, d_n)},    \nonumber 
\end{align}
and
\begin{align}                                                                                                               \label{th2.3Ber}
  &amp;\sum_{j=0}^{K-1}   B_{m}\l(\frac{j}{K}\r) s_{k_1}^{(1)}(j) \cdots s_{k_n}^{(n)}(j)        \\
 &amp; = \frac{B_{m}}{K^{m-1}}  
\sum_{d_1|k_1, \ldots, d_n|k_n} \frac{f_{1}(d_1) \cdots f_{n}\l(d_n\r)}{\lcm(d_1,\ldots, d_n)^{1-m}}
g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r).                     \nonumber  
\end{align}
\end{theorem}

As an application of Theorem \ref{th_main3}, we give three formulas for weighted averages of the product
 $\gcd(k_{1},j)\gcd(k_{2},j)\cdots \gcd(k_{n},j)$  of the gcd's. 


\begin{example}  \label{ex_th_main3}
Let the notation be as above. Then  we have   
\begin{align}                                                                                                               \label{Cor2.41}
&amp;\sum_{j=1}^{K} \gcd(k_{1},j) \cdots \gcd(k_{n},j)  \log\Gamma\l(\frac{j}{K}\r)     \\
&amp;= K\log\sqrt{2\pi} \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}\frac{\phi(d_1) \cdots \phi(d_n)}{\lcm(d_1,\ldots, d_n)}  
       +\frac12 \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}\phi(d_1)  \cdots \phi(d_n)  \log \lcm(d_1,\ldots, d_n)  \nonumber \\
&amp;\quad  -  k_1 k_2 \cdots k_n   \log\sqrt{2\pi  K},  \nonumber
\end{align}
\begin{align} 
&amp; \frac{1}{2^K} \sum_{j=0}^{K}   {K \choose j}  \gcd({k_1},j) \cdots \gcd({k_n},j)                                           \label{Cor2.43} \\
  &amp;\qquad  \quad = \sum_{d_1|k_1, \ldots, d_n|k_n} \frac{\phi(d_1) \cdots \phi(d_n)}{\lcm(d_1,\ldots, d_n)^{}} 
   \sum_{l=1}^{\lcm(d_1, \ldots, d_n)} (-1)^{\frac{Kl}{\lcm(d_1, \ldots, d_n)}} \cos^{K}\frac{l\pi}{\lcm(d_1, \ldots, d_n)}   \nonumber        
\end{align}
and
\begin{align}                                                                                                               \label{Cor2.42}
  \sum_{j=0}^{K-1}&amp;   B_{m}\l(\frac{j}{K}\r) \gcd({k_1},j) \cdots \gcd({k_n},j)        
  = \frac{B_{m}}{K^{m-1}}  
\sum_{d_1|k_1, \ldots, d_n|k_n} \frac{\phi(d_1) \cdots \phi(d_n)}{\lcm(d_1,\ldots, d_n)^{1-m}}.                                    
\end{align}
\end{example}



We substitute $f_1 =\cdots =f_{n}=\phi$ and $g_1 =\cdots =g_{n}={\bf 1}$ in (\ref{th2.3Gamma}) and
 $f_1 =\cdots =f_{n}=\phi$ and $g_1 =\cdots =g_{n}={\bf 1}$ in  (\ref{th2.3Bino})  
to obtain (\ref{Cor2.41}) and (\ref{Cor2.43}), respectively.
We also substitute $f_1 =\cdots =f_{n}=\phi$ and $g_1 =\cdots =g_{n}={\bf 1}$ in (\ref{th2.3Ber}) to obtain  (\ref{Cor2.42}), 
which is an analogue of (\ref{gcd}). 





\section{Proofs of Theorems \ref{th_main1}, \ref{th_main2}, \ref{th_main3} and Corollaries \ref{cor1}, \ref{cor2}, \ref{cor3}} 


\begin{proof}[Proof of Theorem \ref{th_main1}]
Since 
$$
t_{k_i}^{(i)}(j)=\sum_{d_i|\gcd(k_{i},j)}f_{i}(d_i)g_{i}\l(\frac{k_{i}}{d_i}\r)h_{i}\l(\frac{j}{d_i}\r) \quad  (i=1,2,\ldots,n),
$$ 
we have 
\begin{align}                                                                                                              \label{U_r}
&amp;  U_{r}(k_{1},\ldots,k_{n})    \\
&amp; =\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r)   
\sum_{j=1 \atop {{d_{1}|j, \ldots, d_{n}|j}} }^{K}w_{r}(j) h_{1}\l(\frac{j}{d_1}\r) \cdots   h_{n}\l(\frac{j}{d_n}\r)\nonumber \\
&amp; =\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r)  \times  \nonumber \\
&amp;\qquad  \times   \sum_{l=1 }^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}w_{r}\l(l \lcm(d_{1},\ldots,d_{n})\r)
 h_{1}\l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_1}l\r) \cdots   h_{n}\l(\frac{\lcm(d_{n},\ldots,d_{n})}{d_n}l\r).                         \nonumber  
\end{align}
We use the completely multiplicative function $w_r$ in (\ref{U_r}) to obtain 
\begin{align}                                                                                                             \label{U_r1}
&amp; U_{r}(k_{1},\ldots,k_{n})  \\
&amp;=\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n} } 
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) w_{r}\l(\lcm(d_{1},\ldots,d_{n})\r) \times  \nonumber \\
&amp;\qquad   \times   \sum_{l=1 }^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}w_{r}\l(l\r)
 h_{1}\l(\frac{\lcm(d_{1},\ldots,d_{n})}{d_1}l\r) \cdots   h_{n}\l(\frac{\lcm(d_{n},\ldots,d_{n})}{d_n}l\r),  \nonumber 
\end{align}
and if $h_1, \ldots, h_n$ are completely multiplicative functions, (\ref{U_r1}) gives 
\begin{align*}
 &amp;U_{r}(k_{1}, \ldots, k_{n}) \\
&amp;= \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} f_{1}(d_{1}) g_{1}\l(\frac{k_1}{d_1}\r) h_{1}\l(\frac{\lcm(d_1, \ldots, d_n)}{d_1} \r) 
\cdots
f_{n}(d_{n})g_{n}\l(\frac{k_n}{d_n}\r)    \times  \nonumber  \\
&amp; \qquad  \times   h_{n}\l(\frac{\lcm(d_1,\ldots,d_n)}{d_n} \r)w_{r}\l(\lcm(d_{1},\ldots,d_{n})\r)    
  \sum_{l=1}^{\frac{K}{\lcm(d_{1}, \ldots, d_{n})}}w_{r}(l) h_{1}\l(l\r)\cdots h_{n}\l(l\r).      \nonumber     
\end{align*}
Similarly, as in the proof of the above, using the completely additive function  $w_r$ in (\ref{U_r}), 
we have the identity (\ref{th2.2}), 
and if $h_1, \ldots, h_n$ are completely multiplicative functions, we establish the identity (\ref{th2.2cm}).
This completes the proof of Theorem \ref{th_main1}. 
\end{proof}

\begin{proof}[Proof of Corollary \ref{cor1}]
We substitute $w_{r}={\rm{id}}_r$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.1cm}) and use 
\begin{align}
\sum_{m=1}^{N}m^{r}=\frac{N^r}{2} + \frac{1}{r+1}\sum_{m=0}^{\lfloor \frac{r}{2} \rfloor}{r+1 \choose 2m} B_{2m}N^{r+1-2m}        \label{m^r}  
\end{align}
for any positive integer $N&gt;1$ \ \cite[Proposition 9.2.12]{Coh}, \cite[Section 3.9]{Com} 
to obtain 
\begin{align*}
&amp; \sum_{j=1 }^{K}j^{r}s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)                                                \\
&amp;=\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \lcm(d_{1},\ldots, d_{n})^{r} 
  \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}} l^{r}                                               \\
&amp;=\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \lcm(d_{1},\ldots, d_{n})^{r} \times \\
&amp; \times \left\{\frac12 \l(\frac{K}{\lcm(d_{1},\ldots, d_n)}\r)^{r} 
+ \frac{1}{r+1}\sum_{m=0}^{\lfloor \frac{r}{2} \rfloor} {r+1 \choose 2m} B_{2m} \l(\frac{K}{\lcm(d_{1},\ldots,d_{n})}\r)^{r+1-2m}\right\}  \\
&amp;=\frac{(f_{1}*g_{1})(k_1)\cdots (f_{n}*g_{n})(k_n)}{2}K^{r}                       \nonumber  \\
&amp; +\frac{K^{r+1}}{r+1}\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}\frac{B_{2m}}{K^{2m}}
\sum_{d_{1}|k_{1}, \ldots, d_{n}|k_{n}}\frac{f_{1}(d_1)\cdots f_{n}(d_n)}{\lcm(d_{1},\ldots,d_{n})^{1-2m}}
g_{1}\l(\frac{k_1}{d_1}\r)\cdots g_{n}\l(\frac{k_n}{d_n}\r),
\end{align*}
which proves (\ref{Cor2.11}). 
We substitute $g_{1}=\cdots =g_{n}= {\bf {1}}$ and  $w_{r}={\rm{id}}_r$ in (\ref{th2.1}) and 
$f_{1}=\cdots =f_{n}= {\bf {1}}$ and $w_{r}={\rm{id}}_r$ in (\ref{th2.1}) to obtain 
the formulas for (\ref{Cor2.12}) and (\ref{Cor2.13}), respectively. 
\end{proof}

\begin{proof}[Proof of Corollary \ref{cor2}]
We substitute $w_{r}=\log$ and $h_{1}=\cdots =h_{n}={\bf 1}$ in (\ref{th2.2}) to obtain  
\begin{align*}
&amp; \sum_{j=1}^{K}  s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j) \log j  \\
&amp;=K\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
\frac{\log \lcm(d_{1},\ldots, d_{n})}{\lcm(d_{1},\ldots, d_{n})}   \\
&amp;\qquad   +  \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} 
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \sum_{l=1}^{\frac{K}{\lcm(d_{1},\ldots,d_{n})}}\log l     \\
&amp;= K\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
\frac{\log \lcm(d_{1},\ldots, d_{n})}{\lcm(d_{1},\ldots, d_{n})}   \\
&amp;\qquad   +  \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}} 
f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \log \l(\frac{K}{\lcm(d_{1},\ldots, d_{n})}\r)!.     
\end{align*}
Furthermore, we substitute $g_{1}=\cdots =g_{n}={\bf 1}$ and $w_{r}=\log$ in (\ref{th2.2}) and $f_{1}=\cdots =f_{n}={\bf 1}$ 
and $w_{r}=\log$ in (\ref{th2.2}) to get 
the formulas (\ref{Cor2.22}) and (\ref{Cor2.23}), respectively. 
\end{proof}

\begin{proof}[Proof of Theorem \ref{th_main2}]
Let $K=\lcm(k_{1},\ldots,k_{n})$ be 
 the least common multiple of $n$-tuple positive integers $k_{1}, \ldots, k_{n}$. 
Note that $t_{k}(j)=t_{k}(\gcd(k,j))$ for any positive integers $k$ and $j$. 
Since $\gcd(\gcd(j,K),k_i)=\gcd(j,\gcd(K,k_i))=\gcd(j,k_i)$ for any $i\in \{1,2,\ldots, n\}$,  
 we observe that $t_{k_i}^{(i)}(j)$ is equal to $t_{k_i}^{(i)}(\gcd(j,K))$. 
If $w_r$ is a completely multiplicative function, we have
\begin{align*}
 U_{r}(k_{1},\ldots,k_{n})  
&amp;=\sum_{j=1}^{K}w_{r}(j) t_{k_1}^{(1)}(\gcd(j,K))\cdots t_{k_n}^{(n)}(\gcd(j,K))  \\ 
&amp;=\sum_{d|K}w_{r}(d)t_{k_1}^{(1)}(d)\cdots t_{k_n}^{(n)}(d)\sum_{l=1 \atop \gcd \l(l,\frac{K}{d}\r)=1}^{\frac{K}{d}}w_{r}(l)  \\
&amp;=\sum_{d|K}w_{r}\l(\frac{K}{d}\r)t_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots t_{k_n}^{(n)}\l(\frac{K}{d}\r)
  \sum_{l=1 \atop \gcd \l(l,d\r)=1}^{d}w_{r}(l), 
\end{align*}
which completes the proof of the formula (\ref{th2.3cm}). 
Similarly, as in the proof of  (\ref{th2.3cm}), we have (\ref{th2.3ca}).
\end{proof}

To prove Corollary \ref{cor3}, we need the following formula. 

\begin{lemma}  \label{lem1}
For any positive integers $N &gt;1$  and $r$, 
we have 
\begin{align}
 \sum_{l=1 \atop \gcd(l,N)=1}^{N}\log l 
&amp;= \sum_{d|N}\mu\l(\frac{N}{d}\r)\log(d!) - \phi(N)\sum_{p|N}\frac{\log p}{p-1}                                           \label{lem4.12}
\end{align}
and   
\begin{align}
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}B_{2m} = \frac{r+1}{2}.                                                    \label{lem4.13}  
\end{align}

\end{lemma}

\begin{proof}
Using the well-known identity 
$$
\sum_{d|N}\frac{\mu(d)}{d}\log d = -\frac{\phi(N)}{N} \sum_{p|N}\frac{\log p}{p-1} 
$$
\cite[Exercise  10.8.45 (c)]{Coh}, we have 
\begin{align*}
   \sum_{l=1 \atop \gcd(l,N)=1}^{N}\log l
&amp; = \sum_{d|N} \mu(d) \sum_{j=1}^{N/d} \log \l(dj\r)            \\
&amp;=\sum_{d|N} \mu(d)\log\l(\frac{N}{d}\r)! + N \sum_{d|N}\frac{\mu(d)}{d}\log d         \\
&amp;= \sum_{d|N} \mu(d)\log\l(\frac{N}{d}\r)! - \phi(N)\sum_{p|N}\frac{\log p}{p-1},    
\end{align*}
which completes the proof of (\ref{lem4.12}). 
From Theorem 12.15 in \cite{Ap}, we have 
$$
\sum_{m=0}^{r}{r+1 \choose m}B_{m}=0.
$$
It follows that 
$$
{r+1 \choose 0}B_{0}+{r+1 \choose 1}B_{1}+{r+1 \choose 2}B_{2}+ \ldots +{r+1 \choose 2[\frac{r}{2}]}B_{2[\frac{r}{2}]}=0. 
$$
Since $B_{0}=1$, $B_{1}=-\frac12$ and $B_{2m+1}=0$ for any positive integer $m$,  we obtain the formula (\ref{lem4.13}). 
\end{proof}


\begin{proof}[Proof of Corollary \ref{cor3}]
We substitute $w_r ={\rm{id}}_{r}$ and $h_{1} = \cdots =h_{n}={\bf 1}$ in  (\ref{th2.3cm})
and use the  formula \cite[Corollary 4]{Sin} 
\begin{align}
 \sum_{m=1 \atop \gcd(m,N)=1}^{N}m^{r} 
&amp;= \frac{N^{r+1}}{r+1}\sum_{m=0}^{\lfloor \frac{r}{2} \rfloor}{r+1 \choose 2m} {B_{2m}}\phi_{1-2m}(N)                        \label{lem4.11}
\end{align}
for any positive integers $N &gt;1$, and $r$
to obtain 
\begin{align*}
&amp; \sum_{j=1 }^{K}j^{r}s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)    \\
&amp; =\sum_{d|K}d^{r}s_{k_1}^{(1)}(d) \cdots s_{k_n}^{(n)}(d) \sum_{l=1 \atop \gcd \l(l,\frac{K}{d}\r)=1}^{K/d}l^r   \\
&amp;= K^{r}s_{k_1}^{(1)}(K)\cdots s_{k_n}^{(n)}(K)  
+  \frac{K^{r}}{r+1}\sum_{d|K \atop d&lt;K}s_{k_1}^{(1)}\l({}{d}\r)\cdots s_{k_n}^{(n)}\l({}{d}\r)
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}B_{2m} \phi_{1-2m}\l(\frac{K}{d}\r)            \\
&amp;= K^{r}s_{k_1}^{(1)}(K)\cdots s_{k_n}^{(n)}(K)  
+  \frac{K^{r}}{r+1}\sum_{d|K \atop d&gt;1}s_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r)
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}B_{2m} \phi_{1-2m}\l({}{d}\r)            \\
&amp;= K^{r}s_{k_1}^{(1)}(K)\cdots s_{k_n}^{(n)}(K)  
-   \frac{K^{r}}{r+1} s_{k_1}^{(1)}(K)\cdots s_{k_n}^{(n)}(K) \sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose  2m}B_{2m}   \\
&amp; +  \frac{K^{r}}{r+1}\sum_{d|K}s_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r)
\sum_{m=0}^{\lfloor r/2 \rfloor}{r+1 \choose 2m}B_{2m} \phi_{1-2m}\l({}{d}\r).            
\end{align*}
Using   the well-known  identity  (\ref{lem4.13}),  
we obtain   the formula  (\ref{Cor2.31}).  
 We also substitute $w_r = \log $ and $h_{1} = \cdots =h_{n}={\bf 1}$ in  (\ref{th2.3ca}),
and use (\ref{lem4.12}) to obtain 
\begin{align*}
 \sum_{j=1 }^{K}&amp;s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j)\log j \nonumber \\
&amp;=(s_{k_1}^{(1)}\cdots s_{k_n}^{(n)}\cdot \log *\phi)(K) 
+ \sum_{d|K}s_{k_1}^{(1)}\l(\frac{K}{d}\r) \cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r) \sum_{e|d}\mu(e)\log\l(\frac{d}{e}\r)! \\
&amp; \quad - \sum_{d|K}s_{k_1}^{(1)}\l(\frac{K}{d}\r)\cdots s_{k_n}^{(n)}\l(\frac{K}{d}\r)\phi(d) \sum_{p|d}\frac{\log p}{p-1}.
\end{align*}
\end{proof}


\begin{proof}[Proof of Theorem \ref{th_main3}]
Using (\ref{Gamma}) and 
substituting $w_r (d)=\log \Gamma\l(\frac{d}{K}\r)$ and $h_1 =\cdots =h_{1}={\bf 1}$ in (\ref{U_r}), we have
\begin{align*}
&amp; \sum_{j=1}^{K} s_{k_1}^{(1)}(j)\cdots s_{k_n}^{(n)}(j) \log\Gamma\l(\frac{j}{K}\r)                       \\
&amp; =\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r)
 \sum_{l=1}^{\frac{K}{\lcm(d_1,\ldots, d_n)}}   \log\Gamma\l(\frac{\lcm(d_1,\ldots,d_n)}{K}l\r)                     \\ 
&amp;  =\sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) \times   \\
&amp; \quad  \times \left\{\frac{K}{\lcm(d_1,\ldots, d_n)} \log\sqrt{2\pi} -\log \sqrt{2\pi K} + \log \sqrt{\lcm(d_1,\ldots, d_n)} \right\}       \\
&amp;= K \log\sqrt{2\pi} \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}\frac{f_{1}(d_1) \cdots f_{n}(d_n)}{\lcm(d_1,\ldots, d_n)} 
g_{1}\l(\frac{k_1}{d_1}\r)\cdots  g_{n}\l(\frac{k_n}{d_n}\r)                                                 \\
 &amp; \quad   -  \log\sqrt{2\pi K} \sum_{d_{1}|k_{1}}f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) 
\cdots \sum_{d_{n}|k_{n}} f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r)                                                           \\
&amp; \quad  +   \sum_{d_{1}|k_{1},\ldots, d_{n}|k_{n}}f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r)
   \log \sqrt{\lcm(d_1,\ldots,d_n)},  
\end{align*}
which completes the proof of (\ref{th2.3Gamma}).  
We set  $w_{r}(j)={K \choose j}$ and  $h_1 =\cdots =h_{1}={\bf 1}$. Using (\ref{Bino}),   we have 
\begin{align*}
&amp;   \sum_{j=0}^{K} {K \choose j} s_{k_1}^{(1)}(j) \cdots s_{k_n}^{(n)}(j)                                               \\
&amp; = \sum_{d_1|k_1, \ldots, d_n|k_n} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots   f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
 \sum_{m=0}^{\frac{K}{\lcm(d_1,\cdots, d_n)}}{K \choose \lcm(d_1,\ldots, d_n) m}                                                \\
&amp;=2^{K} \sum_{d_1|k_1, \ldots, d_n|k_n} \frac{f_{1}(d_1)\cdots f_{n}(d_n)}{\lcm(d_1,\ldots,d_n)} \times \\
&amp; \qquad \times g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r) 
  \sum_{j=1}^{\lcm(d_1,\ldots, d_n)} \cos^{K}\frac{j\pi}{\lcm(d_1,\ldots,d_n)} \cos \frac{Kj\pi}{\lcm(d_1,\ldots,d_n)}\\
&amp; = 2^{K} \sum_{d_1|k_1, \ldots, d_n|k_n} \frac{f_{1}(d_1)\cdots f_{n}(d_n)}{\lcm(d_1,\ldots, d_n )} \times \\
&amp; \qquad  \times g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r)
  \sum_{j=1}^{\lcm(d_1,\ldots, d_n)} (-1)^{\frac{Kj}{\lcm(d_1,\ldots,d_n)}} \cos^{K}\frac{j\pi}{\lcm(d_1,\ldots,d_n)}, 
\end{align*}
hence, we obtain (\ref{th2.3Bino}). Setting  $w_{r}(j)=B_{m}\l(\frac{j}{K}\r)$ and  $h_1 =\cdots =h_{1}={\bf 1}$ 
and using  (\ref{Ber}), we have 
\begin{align*}
 &amp; \sum_{j=0}^{K-1}  B_{m}\l(\frac{j}{K}\r)  s_{k_1}^{(1)}(j) \cdots s_{k_n}^{(n)}(j)   \\
 &amp;=\sum_{d_1|k_1, \ldots, d_n|k_n} f_{1}(d_1)g_{1}\l(\frac{k_1}{d_1}\r) \cdots   f_{n}(d_n)g_{n}\l(\frac{k_n}{d_n}\r) 
 \sum_{l=0}^{\frac{K}{\lcm(d_1,\ldots, d_n)}-1} B_{m}\l(\frac{\lcm(d_1,\ldots, d_n)}{K}l\r)        \\
&amp; = \frac{B_{m}}{K^{m-1}}  
\sum_{d_1|k_1, \ldots, d_n|k_n} \frac{f_{1}(d_1) \cdots f_{n}\l(d_n\r)}{\lcm(d_1,\ldots, d_n)^{1-m}}
g_{1}\l(\frac{k_1}{d_1}\r) \cdots g_{n}\l(\frac{k_n}{d_n}\r). 
\end{align*}
Hence, we prove (\ref{th2.3Ber}). 
\end{proof}



\section{Acknowledgments}
The authors deeply thank the referee for carefully reading this paper and useful  comments. 


\begin{thebibliography}{99}
\bibitem{A3} E. Alkan,  On the mean square averages of special values of $L$-functions,
{\it J. Number Theory}  {\bf 131} (2011), 1470--1485.  


\bibitem{A1} E. Alkan,  Distribution of averages of Ramanujan sums,
{\it Ramanujan J.} {\bf 29} (2012), 385--408. 


\bibitem{A4} E. Alkan,  Averages of values of $L$-series, 
{\it Proc. Amer. Math. Soc}  {\bf 141} (2013), 1161--1175. 


\bibitem{A2} E. Alkan,  Ramanujan sums are nearly orthogonal to powers,
{\it J. Number Theory}  {\bf 140} (2014), 147--168. 


\bibitem{AA} D. R. Anderson and T. M. Apostol,  The evaluation of Ramanujan's sum and generalizations,
{\it Duke Math. J.} {\bf 20} (1952), 211--216.  



\bibitem{A}T. M. Apostol, Arithmetical properties of generalized Ramanujan sums,
{\it Pacific J. Math} {\bf 41} (1972) 281--293. 


\bibitem{Ap}  T. M. Apostol,  {\it Introduction to Analytic Number Theory},  Springer, 1976. 


\bibitem{Coh} H. Cohen, {\it Number Theory, Volume II:  Analytic and Modern Tools},
Graduate Texts in Mathematics, {\bf 240}, Springer, 2007. 


\bibitem{Com} L. Comtet, {\it Advanced Combinatorics, The Art of Finite and Infinite Expansions},
D. Reidel Publishing Co, 1974. 


\bibitem{DKK} A. Deitmar,  S. Koyama, and N. Kurokawa,
Absolute zeta functions,
{\it Proc. Japan Aca. Ser. A Math. Sci.} {\bf 84} (2008), 138--142.


\bibitem{KMU} I. Kiuchi, M. Minamide, and M. Ueda,  Averages of Anderson--Apostol's sums,
{\it J. Ramanujan  Math.  Soc.},  to  appear.   


\bibitem{L} V. A. Liskovets,  A multivariate arithmetic function of combinatorial and topological significance,
{\it Integers} {\bf 10} (2010), 155--177.   
  

\bibitem{Mi} N. Minami,  On the random variable
$\mathbb{N} \ni l \mapsto {\rm{gcd}}(l, n_{1}) {\rm{gcd}}(l, n_{2}) \cdots {\rm{gcd}}(l, n_{k}) \in \mathbb{N}$.  Preprint, 2009, available at
\url{http://arxiv.org/abs/0907.0918v2}.


\bibitem{M} P. J. McCarthy,  {\it Introduction to Arithmetical Functions},  Springer, 1986.  

\bibitem{MN}  A. D. Mednykh and R. Nedela,  Enumeration of unrooted maps with given genus,
{\it J.  Combin. Theory, Ser. B} {\bf 96} (2006), 706--729.


\bibitem{Sin} J. Singh, Defining power sums of $n$ and $\phi(n)$ integers,
{\it Int. J. Number Theory} {\bf 5} (2009), 41--53.  


\bibitem{S} R. Sivaramakrishnan, {\it Classical Theory of Arithmetic Functions},
Monographs and Textbooks in Pure and Applied Mathematics, Vol.{\bf 126}, Marcel Dekker, 1989.  


\bibitem{To1} L. T\'{o}th, Averages of Ramanujan sums:\ Note on two
papers by E. Alkan, {\it Ramanujan J}.  {\bf 35} (2014), 149--156.


\bibitem{To4} L. T\'{o}th, Sums of products of Ramanujan sums, 
{\it Annali dell' Universita di Ferrara}, {\bf 58} (2012), 183--197.  


\bibitem{To2} L. T\'{o}th, Some remarks on a paper of V. A. Liskovets,
{\it Integers:\ Elec. J. Combinatorial Number Theory}
{\bf 11} (2011), Paper \#A51.


\bibitem{To3} L. T\'{o}th, Menon's identity and arithmetical sums representing functions of several variables,
{\it Rend. Semin. Mat. Univ. Politec. Torino} {\bf 69} (2011), 97--110.


\bibitem{To5} L. T\'{o}th, Weighted gcd-sum functions,
{\it J. Integer Sequences}  {\bf 14} (2011), 
\href{https://cs.uwaterloo.ca/journals/JIS/VOL14/Toth/toth9.html}{Article 11.7.7.}
\end{thebibliography}

\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11A25; Secondary 11B68.

\noindent \emph{Keywords: }
arithmetical function, Ramanujan's sum, greatest common divisor.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences
\seqnum{A018804},
\seqnum{A051193},
\seqnum{A056188}, and
\seqnum{A159068}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received August 18 2015;
revised versions received November 21 2015; March 17 2016.
Published in {\it Journal of Integer Sequences}, March 18 2016.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}
</pre></body></html>