Something related to the Bailey-Borwein-Plaff formula.

How to put this method into practice?

  • 3
    Everything is clear, except for one thing: what is the essence of the question? You have formulas, we can program / learn. What help is needed then? - jmu
  • In the hexadecimal system of the formula, it seems, and is implemented. Understand how a mathematician, describe the sequence, and we, cool programmers, write code so that you try to win in some kind of competition :) - Sergiks
  • formulas we have. we are able to program. but only if you go deep into the question, there appears a huge cloud of its own nuances, and "pitfalls". with such a mat. describing that even the institute course of higher mathematics is not enough for me to understand. but I would like to know where to start and where to go. - slava_evm

3 answers 3

The method of Buffon (Monte Carlo) try. More matches threw more accuracy. It may be easier to throw another match than to calculate the next member of the series. You can also use a dirty hack, insert a value already calculated by someone else into memory and request the Nth sign from there, then there will be infinite performance

    From the formula and the statement “what can be calculated without the previous ones” it turns out that the kth hexadecimal character is calculated like this:

    4/(8k+1) - 2/(8k+4) - 1/(8k+5) - 1/(8k+6) 

    but I don’t really understand why the remnants do not affect the other signs as a result, let's try to calculate, say, the 100th sign:

     4/(8*100+1) - 2/(8*100+4)-1/(8*100+5) - 1/(8*100+6) = 0,0012.... 

    The total result affects 103 characters ... here are obviously the previous results you need .... i.e. one fig in order to accurately calculate the kth sign, you must know the results of <k. Or can there be some mega conversion with this formula?

    • hmm, I certainly don’t claim to be true, but does the fact that the decimal point is transferred from one number system to another is also no problem, like the fact that after a comma? - rasmisha
    • As far as I caught a glimpse of the essence of the formula , to calculate the N + 1-th character of Pi, it is required to add to the sum no more than N times: Pi = SUM <k> 0 = infinity </ sub> 16 <sup> -k <sup> [4 / (8k + 1) - 2 / (8k + 4) - 1 / (8k + 5) - 1 / (8k + 6)] Ie for the 9th hexadecimal mark, add 0 to 8, multiplied by 16 <sup> Nk </ sup> and divide by (8k + 1), take the fractional part after that. N such sums apparently give N + 1'y figure (the first will be). Did not check - superficially re-read their explanation. - Sergiks
    • @rasmisha, what's the difference? The number is represented as summ ((base) ^ k * (digit)) while the digits before comma are k> = 0, and after k <0. I understand that the Windows calculator does not know how to draw a fraction in the hexadecimal system, but this is not an indicator :-) - Chad
    • @sergiks, just about, in this regard, I do not understand the loud statement "calculate without previous values" - Chad
    • @ Chad where does the calculator come from? translate different decimal fractions into binary 0.7 for example (a reverse translation can also cause a similar problem), so I do not see the point of the fraction written in decimal form in the example - rasmisha

    The previous members are not needed, since by adding discharges we can only influence the older, younger digits do not change. But, therefore, we need, in addition to the N terms of the sum, to also count the Log <sub> 16 </ sub> (N) members in order to take into account their influence on the Nth hexadecimal digit. Somewhere on the Internet, an example of code was found, in principle, an algorithm is understood by reference to the code .