Post Reply 
Little explorations with HP calculators (no Prime)
10-31-2017, 02:22 PM (This post was last modified: 10-31-2017 02:32 PM by pier4r.)
Post: #243
RE: Little explorations with HP calculators (no Prime)
I'd like to share the following little exploration.

Since I am trying to collect as much interesting digital content* as possible with the hp calc torrent I started also to use what I collect there, even just to check possible damaged documents.

While re-reading the hp solve issue no1 , I noticed the exercises about approximating PI.

The MoHPC forums are full of very beautiful attempts to compute as much digits of PI as possible in creative ways. Try on your favorite search engine the search string: site:hpmuseum.org compute pi (I tried it on google).

Therefore I was unmoved by the exercise, I mean it appeared quite trivial (not the part with the continued fraction though). Nonetheless I gave it a shot to use a bit my 506w and I can be damned, it led to nice questions! From whatever exercise (or action) one can open up a nice world that one did not see before.

So my related question to the exercise was to find the following:
- given a fixed denominator D that is a whole number.
- find the largest whole number L so that L/D < PI and the smallest whole number H so that H/D > PI
- increase D of 1 and do the entire procedure again.

In this way one find, for each fixed D, a range that enclose PI in terms of L and H.
What interested me is that it seems that it builds a pattern pretty quickly:
Code:

(denominator L H)
x/1: 3 4
x/2: 6 7
x/3: 9 10
x/4: 12 13
x/5: 15 16
x/6: 18 19
x/7: 21 22
x/8: 25 26
x/9: 28 29
....

One can observe that after denominators that are multiple of 7 the next L is 3 units bigger as the previous H instead of 2.

While I could explain myself why a range, for whatever denominator, seems to be only 1 unit large, I was curious about the +3 jump and so far I discovered that it is not only caused after denominators that are multiple of 7. The denominator that cause the next range to be 3 units apart is 113, from the famous 355/133.

So thanks to the hp 50g and the following naive program
Code:

\<<
    1               "lvFirstDenominator"                  DROP
    1000           "lvLastDenominator"                   DROP
    0               "lvMinValue"                          DROP
    0               "lvMaValue"                           DROP
    
    \->
    lvFirstDenominator
    lvLastDenominator
    lvMinValue
    lvMaxValue
    
    \<<
      lvFirstDenominator lvLastDenominator
      FOR lvDenominator
        lvDenominator \pi * IP
          @ this give us the largest integer numerator that
          @ makes x/lvDenominator smaller than Pi.
        
        @ then we need to find the smallest integer numerator that
        @ makes x/lvDenominator greater than pi.
        @ According to my test on paper this seems to be always
        @ a number one value higher than the one previously found.
        @ I did not prove it, so let's be safe.
        @ no, without being safe. I may have a non-rigorous proof.
        @ if den*pi = K , where K is real with decimals since 'den' is an integer,
        @ and den*x = int(K) = floor(K) because x is exactly floor(den*pi); then
        @ den*(x+1) is bigger than den*pi. 
        @ den*(x+1) cannot be equal to den*pi because
        @ 'den' and 'x+1' are integers while pi is a real with decimals.
        @ x+1 cannot be smaller than 'den*pi' because by construction the largest
        @ multiple of 'den' smaller than 'den*pi' is 'den*x' thus 'den*(x+1)'
        @ is bigger than 'den*pi' and therefore (x+1) is the upper bound
        @ of the wanted range.
        DUP 1 + @compute x+1
      NEXT
      
      @we have on the stack many values now, let's pack them in a list
      @how many?
      lvLastDenominator lvFirstDenominator - 1 +
      2 *
      \->LIST
      
      @now compute the differences between values in the list
      DUP \GDLIST
    \>>

and some manual manipulations directly on the hp50g I collected the denominators that shows L numerators with +3 difference from the previous H.
The sequence is like: { 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 106, 114, 121 ... }.
The sequence is not yet in the OEIS database for what I know.

To obtain it, after the \GDLIST pick all the positions that contains a 3 (with MPOS of the listEXT library it is easy) . Then divide the results by 2 and after that apply CEIL. It should return the related denominators of the range that was 3 unit away from the previous one.

I am pretty sure this question was already explored, but still it is interesting for me to explore it myself. Does anyone has pointers to studies that explains what I am computing, so I can read them after I finish my personal attempt?
(Edit: found two pointers, although I expected more https://oeis.org/A063438 -- https://oeis.org/A022844 )

Otherwise I should find the time to explain to myself, somehow, why the +2 distance? Why the +3 distances only after some denominators? Are there more distances? Etc...

* related to the hp calculators (and calculators/math in general).

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Little explorations with HP calculators (no Prime) - pier4r - 10-31-2017 02:22 PM



User(s) browsing this thread: 1 Guest(s)