# How to sum over primes

Apologies in advance for the simplicity of the question, but I can't fathom how to write the following as a sum in Mathemaitca:

\begin{align} &\sum_{p}^{a}\sum_{n}^{b}\text{expression} \end{align}

where $p$ runs through the primes.

I would like to plot

\begin{align} &\sum_{p}^{a}\sum_{n}^{b}(1/n)p^{-ns} \end{align}

in $s$ for some $a,b$.

• @Kuba thankyou very much - I think I haven't quite woken up yet! ;) – martin Mar 2 '15 at 11:10
• @kuba - should I delete? – martin Mar 2 '15 at 11:11
• I don't think so. Not bad question. I felt like it is a dupe but I've faile to find one. Let me post an answer. – Kuba Mar 2 '15 at 11:13
• related: 52371 – Kuba Mar 2 '15 at 11:17

 mySum[s_, a_, b_]:= Sum[  1./n p^(-n s),

Edit: skipper inner Sum, thanks to kguler's comment.
• Simpler: Sum[1/n p^(-n s), {n, b}, {p, Prime@Range@PrimePi@a}] (+1) – kglr Mar 2 '15 at 13:34