Let q be a non-zero integer. A D(q)-m-tuple is a set of m distinct positive integers \(\{a_1, a_2, \dots , a_m\}\) such that \(a_ia_j+q\) is a perfect square for all \(1 \leqslant i < j \leqslant m\) . By counting integer solutions \(x\in [1,b]\) of congruences \(x^2 \equiv q \ (\textrm{mod}\ b)\) with \(b\leqslant N\) , we count D(q)-pairs with both elements up to N, and give estimates on asymptotic behaviour. We show that for prime q, the number of such D(q)-pairs and D(q)-triples grows linearly with N. Up to a factor of 2, the slope of this linear function is the quotient of the value of the L-function of an appropriate Dirichlet character (usually a Kronecker symbol) and of \(\zeta (2)\) .