Lemma. For x≥1,

∑p≤x1p=∫1xπ(t)t2dt+O(1).