Table of Chebyshev psi function - Mathematica Stack Exchange most recent 30 from mathematica.stackexchange.com 2019-09-22T03:09:56Z https://mathematica.stackexchange.com/feeds/question/192584 https://creativecommons.org/licenses/by-sa/4.0/rdf https://mathematica.stackexchange.com/q/192584 3 Table of Chebyshev psi function Richard Burke-Ward https://mathematica.stackexchange.com/users/57910 2019-03-04T14:25:20Z 2019-03-05T02:19:42Z <p>This should be easy, but for some reason I'm struggling. The Chebyshev psi function is given as the sum from <code>0</code> to <code>x</code> of the von Mangoldt function <code>MangoldtLambda[x]</code>. I want to tabulate it. Ideally, I'd like to express the function using <code>Sum</code>, but I can't find the right form. This doesn't work:</p> <pre><code>TableForm[ Table[With[{k = 10}, Sum[N[MangoldtLambda[x], 5], {x, 0, k}]], {x, 0, 10}]] </code></pre> <p>This produces a series that makes no sense at all:</p> <pre><code>TableForm[ Table[With[{k = 10}, Sum[N[MangoldtLambda[x], 5], {k, 0, x}]], {x, 0, 10}]] </code></pre> <p><code>Accumulate</code> doesn't work either:</p> <pre><code>TableForm[Table[Accumulate[N[MangoldtLambda[x], 5]], {x, 0, 10}]] </code></pre> <p>Clearly I'm suffering from a failure of imagination, but I'd appreciate help.</p> https://mathematica.stackexchange.com/questions/192584/-/192585#192585 5 Answer by Roman for Table of Chebyshev psi function Roman https://mathematica.stackexchange.com/users/26598 2019-03-04T14:29:30Z 2019-03-05T00:40:18Z <p>There seems to be a duplicate use of the symbol <code>x</code> in your formulas.</p> <pre><code>ChebyshevPsi[x_] := Sum[MangoldtLambda[y], {y, x}] Table[ChebyshevPsi[x], {x, 10}] </code></pre> <blockquote> <p>{0, Log, Log + Log, 2 Log + Log, 2 Log + Log + Log, 2 Log + Log + Log, 2 Log + Log + Log + Log, 3 Log + Log + Log + Log, 3 Log + 2 Log + Log + Log, 3 Log + 2 Log + Log + Log}</p> </blockquote> <p>You can also directly construct a list of these with <code>Accumulate</code>:</p> <pre><code>Accumulate@Array[MangoldtLambda, 10] </code></pre> <blockquote> <p>{0, Log, Log + Log, 2 Log + Log, 2 Log + Log + Log, 2 Log + Log + Log, 2 Log + Log + Log + Log, 3 Log + Log + Log + Log, 3 Log + 2 Log + Log + Log, 3 Log + 2 Log + Log + Log}</p> </blockquote> <p>Plot the deviation of the Chebyshev <span class="math-container">$\psi$</span> function from <span class="math-container">$x$</span>:</p> <pre><code>ListLinePlot[MapIndexed[{#2[], #1 - #2[]} &amp;, Accumulate@Array[MangoldtLambda, 1000]], Frame -&gt; True, FrameLabel -&gt; {x, ψ[x] - x}] </code></pre> <p><a href="https://i.stack.imgur.com/gzTkF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gzTkF.png" alt="enter image description here"></a></p>