  Zagier in [4] discusses a construction of a function $F_{k,D}(x)$ defined for
an even integer $k \geq 2$, and a positive discriminant $D$. This construction
is intimately related to half-integral weight modular forms. In particular, the
average value of this function is a constant multiple of the $D$-th Fourier
coefficient of weight $k+1/2$ Eisenstein series constructed by H. Cohen in
\cite{Cohen}.
  In this note we consider a construction which works both for even and odd
positive integers $k$. Our function $F_{k,D,d}(x)$ depends on two discriminants
$d$ and $D$ with signs sign$(d)=$ sign$(D)=(-1)^k$, degenerates to Zagier's
function when $d=1$, namely, \[ F_{k,D,1}(x)=F_{k,D}(x), \] and has very
similar properties. In particular, we prove that the average value of
$F_{k,D,d}(x)$ is again a Fourier coefficient of H. Cohen's Eisenstein series
of weight $k+1/2$, while now the integer $k \geq 2$ is allowed to be both even
and odd.
