<p><strong>diff</strong> program output N = 27 with this <a href="iofile.php?test=<?=$SelectedTest;?>&amp;file=output">output file</a> to check your program is correct before contributing.
</p>

<p>Each program should use the same step-by-step spigot algorithm to calculate digits of Pi.</p>

<p>Each program should</p>
<ul>
  <li>calculate the first N digits of Pi</li>
  <li>print the digits 10-to-a-line, with the running total of digits calculated</li>
</ul>

<p>Programs should adapt the <strong>step-by-step</strong> algorithm given on pages 4,6 &amp; 7 of <a href="http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/spigot.pdf">Unbounded Spigot Algorithms for the Digits&nbsp;of&nbsp;Pi</a> (156KB pdf). (<strong>Not</strong> the deliberately obscure version given on page 2.)(<strong>Not</strong> the Rabinowitz-Wagon algorithm.)</p>

<p>In addition to language specific multiprecision arithmetic, we will accept programs that use <a href="http://www.swox.com/gmp/">GMP</a>.</p>

<p>For more information see Eric W. Weisstein, "Pi Digits." From <a href="http://mathworld.wolfram.com"><em>MathWorld</em></a>--A Wolfram Web Resource.<br/><a href="http://mathworld.wolfram.com/PiDigits.html">http://mathworld.wolfram.com/PiDigits.html</a></p>

