Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I don't think this argument is correct. The sum here equals $\sum_{p \le n} (\log n - \log p)$, but both $\sum_{p \le n} \log n$ and $\sum_{p \le n} \log p$ are asymptotic to $n$, by the prime number theorem.
How did you deduce $h^0(C,D-A) \ne 0$ in the argument above? Any correct argument must at some point use the hypothesis $g \ge 2$, but it's not clear where you are using this. Anyway, the proof outlined in Arbarello, Cornalba, Griffiths, and Harris, Geometry of algebraic curves, volume I, page 56, exercise 18 mentioned by Felipe Voloch works.
I believe this was published as a "Quickie" problem in Mathematics Magazine when I was a student; I can try to track down the reference, if desired. Maybe the problem is more elementary than what you are looking for.