Suppose we have $D$ prime and $d$ square free. Is there a way to express the smallest integer $n$ that makes $d \vert (Dn2)$? If such an $n$ exists for a given $D$, $d$ it must exist less than $d$, but is there some function of $D$ and $d$ that gives it explicitly?
Hi guys, sorry I caused a fuss. The fact of the matter is (from what my limited understanding tells me) is that is if you solved this question, you could then tackle the weirdly huge error term in Brun's sieve. You're all probably familiar with this sieve, but it frustrates me that we must assume all error terms (typically written) $R_d$ (of fluctuating sign) positive in order to bound its sum as an alternating series. I understand that we expect there to be about $$\frac{N/2}{d}2^{\omega(d)}$$ integers n between $N/2$ and $N$ that will allow $d\vert n(Dn2)$, and I understand that this may sometimes be an overestimate (resulting in a negative $R_d$) or an underestimate (resulting in a positive $R_d$). Furthermore, because Brun's error is written as an alternating series over these $R_d$, the rectification of signs becomes tragic. I was thinking that if my above question was answerable, we would be able to rectify when Brun's main term is an underestimate, and when it is an underestimate, and thus we would not have to simply take the error as the strictly positive sum over $\vert R_d \vert$ which blows up way quicker than it has to. I have been using fairly standard sieve theory notation without explaining it, and for that I apologize. Furthermore I just graduated high school as Gerhard Paseman correctly pointed out, so I apologize further for the elementary nature of my comment. Thank you sirs for your patience, I will keep looking. 


$\\{0,1,2,\ldots,d1\\}$
. I doubt there's a simple formula, since as $D$ varies, the quantity $D^{1}\bmod}{d}$ will jump all over the place. I also doubt it's relevant that $D$ is prime, although $d$ being square free might help. I'm pretty sure people have at least studied the sequence $D^{1}\bmod{p}$ as a function of $D$, where $p$ is prime. But those would be averaging results, or estimating the smallest $D$ such that $D^{1}\bmod{p}$ is also "small". (I'm going to add an "nt" tag.) – Joe Silverman Aug 6 '11 at 19:24