\input amstex
\magnification 1200
\documentstyle{amsppt}

\catcode`\@=11
\newif\iftab@\tab@false
\newif\ifvtab@\vtab@false
\def\tab{\bgroup\tab@true\vtab@false\vst@bfalse\Strich@false%
   \def\\{\global\hline@@false%
     \ifhline@\global\hline@false\global\hline@@true\fi\cr}
   \edef\l@{\the\leftskip}\ialign\bgroup\hskip\l@##\hfil&&##\hfil\cr}
\def\endtab{\cr\egroup\egroup}
\def\vtab{\vtop\bgroup\vst@bfalse\vtab@true\tab@true\Strich@false%
   \bgroup\def\\{\cr}\ialign\bgroup&##\hfil\cr}
\def\endvtab{\cr\egroup\egroup\egroup}
\def\stab{\D@cke0.5pt\null 
 \bgroup\tab@true\vtab@false\vst@bfalse\Strich@true\Let@@\vspace@
 \normalbaselines\offinterlineskip
  \openup\spreadmlines@
 \edef\l@{\the\leftskip}\ialign
 \bgroup\hskip\l@##\hfil&&##\hfil\crcr}
\def\endstab{\crcr\egroup
 \egroup}
\newif\ifvst@b\vst@bfalse
\def\vstab{\D@cke0.5pt\null
 \vtop\bgroup\tab@true\vtab@false\vst@btrue\Strich@true\bgroup\Let@@\vspace@
 \normalbaselines\offinterlineskip
  \openup\spreadmlines@\bgroup}
\def\endvstab{\crcr\egroup\egroup
 \egroup\tab@false\Strich@false}
 
\newdimen\htstrut@
\htstrut@8.5\p@
\newdimen\htStrut@
\htStrut@12\p@
\newdimen\dpstrut@
\dpstrut@3.5\p@
\newdimen\dpStrut@
\dpStrut@3.5\p@
\def\openup{\afterassignment\@penup\dimen@=}
\def\@penup{\advance\lineskip\dimen@
  \advance\baselineskip\dimen@
  \advance\lineskiplimit\dimen@
  \divide\dimen@ by2
  \advance\htstrut@\dimen@
  \advance\htStrut@\dimen@
  \advance\dpstrut@\dimen@
  \advance\dpStrut@\dimen@}
\def\Let@@{\relax\iffalse{\fi%
    \def\\{\global\hline@@false%
     \ifhline@\global\hline@false\global\hline@@true\fi\cr}%
    \iffalse}\fi}
\def\matrix{\null\,\vcenter\bgroup
 \tab@false\vtab@false\vst@bfalse\Strich@false\Let@@\vspace@
 \normalbaselines\openup\spreadmlines@\ialign
 \bgroup\hfil$\m@th##$\hfil&&\quad\hfil$\m@th##$\hfil\crcr
 \Mathstrut@\crcr\noalign{\kern-\baselineskip}}
\def\endmatrix{\crcr\Mathstrut@\crcr\noalign{\kern-\baselineskip}\egroup
 \egroup\,}
\def\smatrix{\D@cke0.5pt\null\,
 \vcenter\bgroup\tab@false\vtab@false\vst@bfalse\Strich@true\Let@@\vspace@
 \normalbaselines\offinterlineskip
  \openup\spreadmlines@\ialign
 \bgroup\hfil$\m@th##$\hfil&&\quad\hfil$\m@th##$\hfil\crcr}
\def\endsmatrix{\crcr\egroup
 \egroup\,\Strich@false}
\newdimen\D@cke
\def\Dicke#1{\global\D@cke#1}
\newtoks\tabs@\tabs@{&}
\newif\ifStrich@\Strich@false
\newif\iff@rst
 
\def\Stricherr@{\iftab@\ifvtab@\errmessage{\noexpand\s not allowed
     here. Use \noexpand\vstab!}%
  \else\errmessage{\noexpand\s not allowed here. Use \noexpand\stab!}%
  \fi\else\errmessage{\noexpand\s not allowed
     here. Use \noexpand\smatrix!}\fi}
\def\format{\ifvst@b\else\crcr\fi\egroup\iffalse{\fi\ifnum`}=0 \fi\format@}
\def\format@#1\\{\def\preamble@{#1}%
 \def\Str@chfehlt##1{\ifx##1\s\Stricherr@\fi\ifx##1\\\let\Next\relax%
   \else\let\Next\Str@chfehlt\fi\Next}%
 \def\c{\hfil\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi\iftab@\else$\m@th\fi\the\hashtoks@\iftab@\else$\fi\hfil}%
 \def\r{\hfil\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi\iftab@\else$\m@th\fi\the\hashtoks@\iftab@\else$\fi}%
 \def\l{\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi\iftab@\else$\m@th\fi\the\hashtoks@\iftab@\else$\fi\hfil}%
 \def\s{\ifStrich@\ \the\tabs@\vrule width\D@cke\the\hashtoks@%
          \fi\the\tabs@\ }%
 \def\sa{\ifStrich@\vrule width\D@cke\the\hashtoks@%
            \the\tabs@\ %
            \fi}%
 \def\se{\ifStrich@\ \the\tabs@\vrule width\D@cke\the\hashtoks@\fi}%
 \def\cd{\hfil\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi$\dsize\m@th\the\hashtoks@$\hfil}%
 \def\rd{\hfil\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi$\dsize\m@th\the\hashtoks@$}%
 \def\ld{\noexpand\ifhline@@\hbox{\vrule height\htStrut@%
   depth\dpstrut@ width\z@}\noexpand\fi%
   \ifStrich@\hbox{\vrule height\htstrut@ depth\dpstrut@ width\z@}%
   \fi$\dsize\m@th\the\hashtoks@$\hfil}%
 \ifStrich@\else\Str@chfehlt#1\\\fi%
 \setbox\z@\hbox{\xdef\Preamble@{\preamble@}}\ifnum`{=0 \fi\iffalse}\fi
 \ialign\bgroup\span\Preamble@\crcr}
\newif\ifhline@\hline@false
\newif\ifhline@@\hline@@false
\def\hlinefor#1{\multispan@{\strip@#1 }\leaders\hrule height\D@cke\hfill%
    \global\hline@true\ignorespaces}
\def\htextfor#1 #2{\multispan@{\strip@#1 }\hfil\hbox{#2}\hfill%
    \global\hline@true\ignorespaces}
\catcode`\@=13
 
%$$\smatrix \format \sa \c\s\r\s\l\se\\
%\omit&x&&2&&1&\\
%\hlinefor{5}\\
%&yy&&44444444444&\omit&33333333333&\\
%\omit&\omit&\hlinefor{5}\\
%\omit&1&& &&\endsmatrix$$
% 
%{\stab \Dicke7pt\format \sa \c\s\r\s\l\se\\
%\omit&x&&2&&1&\\
%\hlinefor{5}\\
%&yy&&44444444444&\omit&33333333333&\\
%\omit&\omit&\hlinefor{5}\\
%\omit&1&& &&\endstab}

\input epsf
\define\({\left(}
\define\){\right)}
\define\eps{\varepsilon}
\define\ph{\varphi}
\topmatter
\title A Note on the Parity of the Sum-of-Digits Function\endtitle
\author Peter J. Grabner\endauthor
\address Institut f\"ur Mathematik A, Technische Universit\"at Graz,
 Steyergasse 30, 8010 Graz, Austria\endaddress
\thanks The author is supported by the Austrian Science Foundation,
 Project Nr.P8274-PHY\endthanks
\email grabner\@weyl.math.tu-graz.ac.at\endemail
\endtopmatter
\document
\heading 1. Introduction\endheading
Let for the following $\nu(n)$ be the binary sum-of-digits function, i.e.
$$\nu\(\sum_{l=0}^L\eps_l2^l\)=\sum_{l=0}^L\eps_l.$$
Newman \cite{Ne} proved that
$$S(N)=\sum_{n<N}(-1)^{\nu(3n)}$$
is always positive and of exact order of magnitude $N^{\log_43}$. Coquet
\cite{Co}
observed that
$$S(N)=N^{\log_43}F(\log_4N)+\frac{\eta(N)}3,\tag1.1$$
where $F(x)$ is a continuous, nowhere differentiable periodic function of
period
$1$ (to speak of continuity makes sense, because the values $\log_4N$ are dense
modulo~$1$) and $\eta(N)$ only takes the values $0,\pm1$. He also gave the
extreme
values of the function $F$. In \cite{FGKPT} the mean value of $F$ was computed.

It is now natural to ask how the function
$$\sum_{n<N}(-1)^{\nu(pn)}$$
behaves for given odd $p$. Numerical studies show that for most values of $p$
this function takes positive and negative values. The asymptotic behaviour like
a power of $N$ times a periodic function persists (cf. \cite{GKS}, \cite{Gr}).
In  a concluding
section we want to give some examples and state conjectures in this context.

We want to
investigate
$$T(N)=\sum_{n<N}(-1)^{\nu(5n)}$$
and will prove
\proclaim{Theorem 1} The function $T(N)$ is positive for $N>0$ and satisfies
$$T(N)=N^\alpha\Phi(\log_{16}N)+\frac{\eta_5(N)}5\tag1.2$$
with a continuous nowhere differentiable periodic function $\Phi$ of period $1$,
$$\eta_5(N)=\cases 0&\text{for $N$ even}\cr (-1)^{\nu(5N-1)}&\text{for $N$
odd,}\endcases$$
and $\alpha=\frac{\log5}{\log16}$. The function $\Phi$ satisfies
$$\align &0.83808514\ldots=\Phi\(\log_{16}\frac{176}{15}\)=
\frac7{10}\(\frac{15}{11}\)^{\alpha}\leq\Phi(x)\cr
&\leq\frac9{10}\(\frac{60}{13}\)^{\alpha}=\Phi\(\log_{16}\frac{52}{15}\)=
2.18677074\ldots\endalign$$
and
$$\int\limits_0^1\Phi(x)\,dx=5^{\alpha-1}\frac{c_1+c_2+c_3+c_4}
{\Gamma(\alpha+1)\log16}=1.56205765115\ldots$$
with
$$\align &c_k=\int\limits_0^\infty\Bigl(g_k(1)e^{-x}+\cdots+g_k(15)e^{-15x}+\cr
&\(1+g_k(1)e^{-x}+\cdots+
g_k(15)e^{-15x}-5\)\(G_k(e^{-16x})-1\)\Bigr)x^{\alpha-1}dx,\endalign$$
where $g_k(n)=e^{\frac{2kn\pi i}5}(-1)^{\nu(n)}$ and
$$G_k(z)=\prod_{m=0}^\infty\(1+g_k(1)z^{16^m}+\cdots+
g_k(15)z^{15\cdot16^m}\).$$
\endproclaim
\heading 2. Proof of the Theorem\endheading
Let for the following $\xi_k=\exp(\frac{2k\pi i}5)$ for $k=0,\ldots,4$. Then it
is an immediate consequence of $16^n\equiv1\mod5$ that
$$g_k(n)=\xi_k^n(-1)^{\nu(n)}\tag2.1$$
satisfies
$$g_k(16n+b)=g_k(n)g_k(b)\quad\text{for }0\leq b\leq15.\tag2.2$$
This property is called ``complete $16$-multiplicativity'' and immediately
yields
$$g_k\(\sum_{l=0}^La_l16^l\)=\prod_{l=0}^Lg_k(a_l).\tag2.3$$
Thus the value of $g_k(n)$ only depends on the digit expansion of $n$ to the
base $16$.

Setting $G_k(M)=\sum_{n<M}g_k(n)$ we have
$$T(N)=\frac15G_0(5N)+\frac15\sum_{k=1}^4G_k(5N)=\frac{\eta_5(N)}5+
\frac15\sum_{k=1}^4G_k(5N).\tag2.4$$
We will now investigate the asymptotic behaviour of $G_k(M)$, $k=1,\ldots,4$:
Let $M=\sum_{l=0}^La_l16^l$ be the $16$-adic expansion of $M$ and set
$M_p=\sum_{l=p}^La_l16^l$. Then we have
$$G_k(M)=\sum_{n<M_L}g_k(n)+\sum_{p=0}^{L-1}\sum_{n=M_{p+1}}^{M_p-1}g_k(n)=
G_k(a_L16^L)+\sum_{p=0}^Lg_k(M_{p+1})G_k(a_p16^p).\tag2.5$$
Thus we have reduced the problem to the computation of $G_k(a16^l)$:
$$G_k(a16^l)=\sum_{\eps<a}g_k(\eps)G_k(16^l)=G_k(a)G_k(16)^l.$$
Notice that
$$G_k(16)=\sum_{n=0}^{15}\xi_k^n(-1)^{\nu(n)}=\prod_{l=0}^3\(1-\xi_k^{2^l}\)=
5.\tag2.6$$
This holds because $2$ is a primitive root $\mod5$ and therefore the product
can be rewritten as $\prod_{l=1}^4(1-\xi_k^l)$. (We will refer to this
argument later in the concluding remarks.)

We rewrite \thetag{2.5}
$$G_k(M)=5^L\sum_{p=0}^L5^{p-L}G_k(a_p)\prod_{l=p+1}^Lg_k(a_l)\tag2.7$$
and set
$$\ph_k\(\sum_{l=0}^\infty a_l16^{-l}\)=
\sum_{l=0}^\infty\prod_{p=0}^{l-1}g_k(a_p)G_k(a_l)5^{-l}.\tag2.8$$
Notice that these functions are well-defined and continuous (this is proved in
a more general setting in \cite{Gr}) and $\ph_k(1)=1$, $\ph_k(16)=5$.

Inserting the definition of $\ph_k$ into \thetag{2.7} yields
$$G_k(M)=5^{[\log_{16}M]}\ph_k\(\frac M{16^{[\log_{16}M]}}\)=
M^{\alpha}5^{-\{\log_{16}M\}}\ph_k\(16^{\{\log_{16}M\}}\),\tag2.9$$
where $[x]$ and $\{x\}$ denote the integer and the fractional part of $x$ as
usual.
We set now $\psi_k(x)=\ph_k(x)x^{-\alpha}$ for $1\leq x\leq16$ 
and observe that
$$\Psi(x)=\frac15\sum_{k=1}^4\psi_k(x)$$
is a continuous function which can be continued periodically (with period $1$).
Then we have
$$T(N)=(5N)^{\alpha}\Psi(5N)+\frac{\eta_5(N)}5.$$
and $\Phi(y)=5^{\alpha}\Psi(5\cdot16^y)$.

In order to compute the extremal values of $\Phi$ we derive an explicit formula
for $\ph(x)=\frac15\sum_{k=1}^4\ph_k(x)$. For this purpose we introduce some
notations:
$$\align&\alpha_1(l,x)=\#\{p<l:a_p=1\vee a_p=11\}\cr
&\alpha_2(l,x)=\#\{p<l:a_p=2\vee a_p=7\}\cr
&\alpha_3(l,x)=\#\{p<l:a_p=3\}\cr
&\alpha_4(l,x)=\#\{p<l:a_p=4\vee a_p=14\}\cr
&\alpha_5(l,x)=\#\{p<l:a_p=6\}\cr
&\alpha_6(l,x)=\#\{p<l:a_p=8\vee a_p=13\}\cr
&\alpha_7(l,x)=\#\{p<l:a_p=9\}\cr
&\alpha_8(l,x)=\#\{p<l:a_p=12\}\cr
&\text{for }x=\sum_{p=0}^\infty\frac{a_p}{16^p}\quad\text{(from now on we
will omit
the dependence on $x$)}\cr
&A(l)=\alpha_1(l)+2\alpha_2(l)+3\alpha_3(l)+
4\alpha_4(l)+\alpha_5(l)+3\alpha_6(l)+4\alpha_7(l)+2\alpha_8(l)\cr
&B(l)=\alpha_1(l)+\alpha_2(l)+\alpha_4(l)+\alpha_6(l)\endalign$$
and
$$\smatrix\format \sa\c\s\c\s\c\s\c\s\c\s\c\se\\
\omit &&&\htextfor{9} {$\quad A(l)\mod5$}&\omit\\
\omit &d(a_l,A(l))&&0&\omit&1&\omit&2&\omit&3&\omit&4&\omit\\
\hlinefor{12}&\omit\\
\omit&0&&0&\omit&\phantom{+}0&\omit&\phantom{+}0&\omit&\phantom{+}0&
\omit&\phantom{+}0&\omit\\
\omit&1&&\frac45&\omit&-\frac15&\omit&-\frac15&\omit&-\frac15&\omit&
-\frac15&\omit\\
\omit&2&&1&\omit&\phantom{+}0&\omit&\phantom{+}0&\omit&\phantom{+}0&\omit&
-1&\omit\\
\omit&3&&\frac65&\omit&\phantom{+}\frac15&\omit&\phantom{+}\frac15&\omit&
-\frac45&\omit&-\frac45&\omit\\
\omit&4&&1&\omit&\phantom{+}0&\omit&\phantom{+}1&\omit&-1&\omit&-1&\omit\\
\omit&5&&\frac65&\omit&-\frac45&\omit&\phantom{+}\frac65&\omit&-\frac45&\omit&
-\frac45&\omit\\
\omit&6&&2&\omit&-1&\omit&\phantom{+}1&\omit&-1&\omit&-1&\omit\\
\omit&7&&\frac95&\omit&-\frac65&\omit&\phantom{+}\frac45&\omit&-\frac65&
\omit&-\frac15&\omit\\
\omit&8&&2&\omit&-1&\omit&\phantom{+}1&\omit&-2&\omit&\phantom{+}0&\omit\\
\omit&9&&\frac{11}5&\omit&-\frac45&\omit&\phantom{+}\frac15&\omit&-\frac95&
\omit&\phantom{+}\frac15&\omit\\
\omit&10&&2&\omit&\phantom{+}0&\omit&\phantom{+}0&\omit&-2&\omit&\phantom{+}0&
\omit\\
\omit&11&&\frac{14}5&\omit&-\frac15&\omit&-\frac15&\omit&-\frac{11}5&\omit&
-\frac15&\omit\\
\omit&12&&3&\omit&\phantom{+}0&\omit&\phantom{+}0&\omit&-2&\omit&-1&\omit\\
\omit&13&&\frac{14}5&\omit&-\frac15&\omit&-\frac15&\omit&-\frac65&\omit&
-\frac65&\omit\\
\omit&14&&3&\omit&\phantom{+}0&\omit&-1&\omit&-1&\omit&-1&\omit\\
\omit&15&&\frac{16}5&\omit&-\frac45&\omit&-\frac45&\omit&-\frac45&\omit&
-\frac45&\omit\\
\endsmatrix$$
We are now able to write
$$\ph(x)=\sum_{l=0}^\infty(-1)^{B(l)}\frac{d(a_l,A(l))}{5^l}.\tag2.10$$
Detailed investigation of the entries of $d(a,A)$ yields $\frac7{10}
\leq\ph\leq4$
and also estimates for $\ph(x)$, $x\in[\frac k{16^l},\frac{k+1}{16^l}]$, 
$16^l\leq k<16^{l+1}$:
$$\aligned&\ph\(\frac k{16^l}\)+(-1)^{B(l+1)}m(B(l+1)+1,A(l+1))5^{-l-1}
\leq\ph(x)\leq\cr
&\ph\(\frac k{16^l}\)+(-1)^{B(l+1)}m(B(l+1),A(l+1))5^{-l-1},\endaligned
\tag2.11$$
where $m(B,A)$ is given by
$$\smatrix\format \sa\c\s\c\s\c\s\c\s\c\s\c\s\c\se\\
\omit&\omit&\omit&&&\htextfor{9} {$\quad A(l)\mod5$}&\omit\\
\omit&\omit&\omit&m(B(l),A(l))&&0&\omit&1&\omit&2&\omit&3&\omit&4&\omit\\
\hlinefor{14}&\omit\\
\omit&&\omit&0&&0&\omit&-\frac{61}{50}&\omit&-\frac{11}{10}&\omit&
-\frac52&\omit&-\frac32&\omit\\
\omit&B(l)\mod2&\omit&&&&\omit&&\omit&&\omit&&\omit&&\omit\\
\omit&&\omit&1&&\phantom{+}4&\omit&\phantom{+}\frac12&\omit&\phantom{+}
\frac32&\omit&\phantom{+}\frac1{10}&\omit&\phantom{+}\frac{11}{50}&\omit
\endsmatrix
$$

Outside the interval $[1,2]$ it can be proved by trivial estimates that
$\Psi(x)<\frac9{10}(\frac{12}{13})^{\alpha}=:M$. The interval
$[1,2]$ has to be splitted into several parts to prove that the maximum of 
$\Psi$
is attained at $x=\frac{13}{12}$.
\roster
\item $1\leq x\leq\frac{17}{16}$: $\ph(x)\leq\frac{1061}{1250}$ and 
$\Psi(x)<\frac{1061}{1250}<M$.
\item $\frac{13}{12}-\frac13 16^{-k}\leq x\leq\frac{13}{12}-\frac13 16^{-k-1}$
 for $k\geq1$:
$\ph(x)\leq\frac9{10}-32\cdot 5^{-k-2}$ and
$\Psi(x)\leq (\frac9{10}-32\cdot 5^{-k-2})(\frac{13}{12}-
\frac13 16^{-k})^{-\alpha}<M$.
\item $\frac{13}{12}\leq x\leq\frac54$: $\ph(x)\leq\frac9{10}$ and 
$\Psi(x)\leq M$
\item $\frac54\leq x\leq\frac{21}{16}$: $\ph(x)\leq\frac{24}{25}$ and 
$\Psi(x)<M$
\item $\frac{21}{16}\leq x\leq\frac{23}{16}$: in this interval some local 
extrema
are attained which are only $\sim\frac1{100}$ smaller than $M$; therefore this
interval has to be split into $32$ intervals of length $\frac1{256}$ to prove
$\Psi(x)<M$.
\item $\frac{23}{16}\leq x\leq2$: $\ph(x)\leq\frac{261}{250}$ and
$\Psi(x)\leq\frac{261}{250}(\frac{16}{23})^{\alpha}<M$.
\endroster

In order to prove that $\Psi(x)\geq\frac7{10}(\frac3{11})^{\alpha}=:m$ we note
first that outside of the interval $[3,4]$ this inequality can be obtained by
trivial estimates. The interval $[3,4]$ again has to be split:
\roster
\item $3\leq x\leq\frac{11}3$: $\ph(x)\geq\frac7{10}$ and $\Psi(x)\geq m$
\item $\frac{11}3+\frac13 16^{-k-1}\leq x\leq\frac{11}3+\frac13 16^{-k}$:
$\ph(x)\geq\frac7{10}+32\cdot5^{-k-3}$ and $\Psi(x)\geq(\frac7{10}+
32\cdot5^{-k-3})
(\frac{11}3+\frac13 16^{-k})^{-\alpha}>m$.
\item $\frac{59}{16}\leq x\leq4$: $\ph(x)\geq\frac{939}{1250}$ and 
$\Psi(x)\geq\frac{939}{1250\sqrt5}>m$
\endroster
After rescaling this yields the extremal values stated in the theorem.

It is an immediate consequence of \thetag{2.11} that for every $x\in[0,1]$ and
every $l>0$ there exists
a $y$ with $|x-y|\leq 16^{-l}$, such that $|\ph(x)-\ph(y)|\geq
\frac{43}{50}5^{-l-1}$.
Thus $\ph$ is nowhere differentiable.

It remains to compute the mean value of $\Phi$. For this purpose we note that
in \cite{Gr} a formula for the Fourier coefficients of a fractal function 
occurring in the
context of $q$-multiplicative functions is developed. Inserting the 
$16$-multiplicative
functions $g_k$ into this formula yields the mean value stated in the theorem.
\qed
\heading 3. Concluding Remarks\endheading
In the recent paper \cite{GKS} the asymptotic behaviour of the summatory
function
$$\sum_{n<N}(-1)^{\nu(pn+q)}$$
for prime numbers $p$ and $0\leq q<p$ is investigated. It turns out that for
all these functions the asymptotic behaviour resembles that discussed in the
previous section; however it seems to be difficult to determine the value of
the exponent of $N$ in the asymptotic formula, because it depends on the value
$$\sum_{n<2^s}\zeta^n(-1)^{\nu(n)}=\prod_{k=0}^{s-1}\(1-\zeta^{2^k}\),$$
where $\zeta$ is a $p$-th root of unity and $s$ is the multiplicative order
of $2$ $\mod p$. In the cases $s=p-1$ and $s=\frac{p-1}2$ it is possible to
derive general formul\ae{} for this expression (cf. \cite{GKS}).

\epsfxsize=12 truecm
\hbox to\hsize{\hfill\epsfbox{Phi.ps}\hfill}
\centerline{\smc The graph of $\Phi(x)$.}


\medskip
By an immediate generalization of the method used above it is possible to 
describe
the behaviour of $\sum_{n<N}(-1)^{\nu(p^rn)}$. The cases $p=3$ and $p=5$ are
the easiest, because $2$ is a primitive root $\mod3^r$ and $\mod5^r$. Here
the asymptotic behaviour of the summands of the formula corresponding to
\thetag{2.4} depends on the order of the root $\exp(\frac{2k\pi i}{p^r})$. The
main term originates from the primitive $3^{\roman {rd}}$ 
($5^{\roman {th}}$~resp.)
roots of unity. This gives asymptotic formul\ae{}
$$\align S_r(N)&=\sum_{n<N}(-1)^{\nu(3^rn)}=\frac1{3^{r-1}}(3^rN)^\beta 
F\(\log_4 3^{r-1}N\)\cr
&+N^{\frac\beta3}F_1\(\frac13\log_4N\)+\cdots+N^{\frac\beta{3^{r-1}}}
F_{r-1}\(\frac1{3^{r-1}}\log_4N\)+\frac{\eta_{3^r}(N)}{3^r}\cr
T_r(N)&=\sum_{n<N}(-1)^{\nu(5^rn)}=\frac1{5^{r-1}}(5^rN)^\alpha
\Phi\(\log_{16}5^{r-1}N\)\cr
&+N^{\frac\alpha5}\Phi_1\(\frac15\log_{16}N\)+\cdots+N^{\frac\beta{5^{r-1}}}
\Phi_{r-1}\(\frac1{5^{r-1}}\log_{16}N\)+\frac{\eta_{5^r}(N)}{5^r},\endalign$$
where $\beta=\log_43$ and $F$ is the fractal function studied in Coquet's
paper \cite{Co}; $\alpha=\log_{16}5$ and $\Phi$ is the fractal function of
Theorem~1 (this is the reason for the cumbersome notation of the two leading 
terms).
The other functions occurring in the formul\ae{} are also continuous
and periodic of period $1$, the $\eta$'s only take the values $0$, $\pm1$.
Therefore these two sums only take at most finitely many negative values.

Let us conclude with some remarks on the sum $U_{rs}(N)=
\sum_{n<N}(-1)^{\nu(3^r5^sn)}$.
The order of $2$ $\mod3^r5^s$ is $4\cdot3^{r-1}5^{s-1}$. Thus $2$ generates
half of $\Bbb Z_{3^r5^s}^*$ and it is not too difficult to compute the possible
values for the exponent: If $\zeta$ is a primitive $3^k5^l$-th root of unity
($0<k\leq r$, $0<l\leq s$) we have
$$P(\zeta)=\prod_{t=0}^{4\cdot3^{k-1}5^{l-1}}\(1-\zeta^{2^t}\)=\pm1,$$
because $P(\zeta)=P(\bar\zeta)$ and $P(\zeta)P(\bar\zeta)=C_{3^k5^l}(1)=1$,
where $C_q$ is the cyclotomic polynomial of order $q$ (these terms only
contribute $O(\log N)$ to $U_{rs}$). Therefore the asymptotic
behaviour of $U_{rs}(N)$ is determined by those terms in the formula analogous
to \thetag{2.4}, which correspond to primitive $3^k$-th and $5^l$-th roots of
unity. But these terms just constitute the sums $S_r$ and $T_s$. This gives
$$U_{rs}(N)=\frac1{3^r5^s}\(3^rS_r(5^sN)+5^sT_s(3^rN)\)+O(\log N)$$
and again we have that $U_{rs}$ only takes at most finitely many negative 
values.
It remains as a question, for which primes $p$ the sum 
$\sum_{n<N}(-1)^{\nu(pn)}$
is always positive. Numerical studies show that $17$, $43$ and $101$ are 
possible
candidates for this property, but this is far from a proof. The method used
to prove this for $p=3$ and $p=5$ could be applied to $p=17$, but would require
immense computations for larger primes.
\vfill\eject
\Refs
\widestnumber\key{FGKPT}
\ref\key Co\by J. Coquet\paper A Summation Formula Related to the Binary Digits
\jour Invent. math.\vol73\pages107--115\yr1983\endref
\ref\key FGKPT\by P. Flajolet, P.J. Grabner, P. Kirschenhofer, H. Prodinger and
R.F. Tichy\paper Mellin Transforms and Asymptotics: Digital Sums\jour Theor. 
Comput.
Sci.\toappear\yr1993\endref
\ref\key GKS\by S. Goldstein, K.A. Kelly and E.S. Speer\paper The Fractal 
Structure
of Rarefied Sums of the Thue-Morse Sequence\jour J. Number Th.\vol 42
\pages1--19
\yr1992\endref
\ref\key Gr\by P.J. Grabner\paper Completely $q$-Multiplicative Functions: the
Mellin-Transform Approach\jour Acta Arith.\toappear\endref
\ref\key Ne\by D.J. Newman\paper On the Number of Binary Digits in a Multiple 
of Three
\jour Proc. A.M.S.\vol21\pages719--721\yr1969\endref
\endRefs
\enddocument
