In this paper we first investigate for what positive integers a,b,c every nonnegative integer n can be written as x(ax+1)+y(by+1)+z(cz+1) with x,y,z integers. We show that (a,b,c) can be either of the following seven triplesiv class="formula" id="fm0010">iv class="mathml">2258bf2ab3ca3db24339">iv>iv> and conjecture that any triple (a,b,c) amongiv class="formula" id="fm0020">iv class="mathml">iv>iv> also has the desired property. For integers 0⩽b⩽c⩽d⩽a with a>2, we prove that any nonnegative integer can be written as x(ax+b)+y(ay+c)+z(az+d) with x,y,z integers, if and only if the quadruple (a,b,c,d) is amongiv class="formula" id="fm0030">iv class="mathml">iv>iv>