Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.math > #405057

Re: formula to calculate the nth prime

Newsgroups sci.math
Date 2018-02-18 19:02 -0800
References <p663sv$1og2$1@gioia.aioe.org> <48a09b08-b085-ef81-5754-86b1c0eb6b9e@att.net> <p67fk4$9vt$1@gioia.aioe.org> <77b4ad64-ebfb-6671-7d07-94295677b7f9@att.net> <p6ddjj$1bio$1@gioia.aioe.org>
Message-ID <a3e84558-ddcf-4d4d-b551-618bf4e590d2@googlegroups.com> (permalink)
Subject Re: formula to calculate the nth prime
From Simon Roberts <retenshun@gmail.com>

Show all headers | View raw


On Sunday, February 18, 2018 at 9:43:10 PM UTC-5, Jamie M wrote:
> On 2/17/2018 8:06 AM, Jim Burns wrote:
> > On 2/16/2018 3:40 PM, Jamie M wrote:
> >> On 2/16/2018 10:31 AM, Jim Burns wrote:
> >>> On 2/16/2018 3:14 AM, Jamie M wrote:
> > 
> >>>> Hi,
> >>>>
> >>>> Here is a formula to calculate the n-th prime, given
> >>>> the primes less than the n-th prime:
> > 
> >>> Whitespace Is Our Friend.
> >>>
> >>> primorial(n) -
> >>> (2*
> >>>     (
> >>>        ( EulerPhi(primorial(n)) ) +
> >>>        ( EulerPhi(primorial(n)) - (1/2*(primorial(n-1))) ) +
> >>>        ( EulerPhi(primorial(n)) - (primorial(n-1)) )
> >>>     )
> >>> )
> >>> = 2* primorial(n-2).
> >>>
> >>> Why didn't you do some pretty obvious simplifications?
> >>> I think this is a lot easier to follow:
> >>>
> >>> primorial(n) - 6*EulerPhi(primorial(n)) + 3*primorial(n-1)
> >>> = 2*primorial(n-2).
> >>>
> >>> Further simplification:
> > 
> >>> ( 6*EulerPhi(primorial(n-1)) - primorial(n-1) )*(x-1)
> >>> =  4*primorial(n-1) - 2*primorial(n-2)
> > 
> > [...]
> >>> 550*(x-1) = 8900
> >>>
> >>> x = 17+
> >>>
> >>> Okay. Now I see why you made it more complicated
> >>> than necessary.
> >>>
> >>> Anyway, remember that Whitespace Is Our Friend,
> >>> for when you're not trolling.
> >>
> >> Hi,
> >>
> >> Sorry wasn't meaning to troll! :)  I actually didn't
> >> test it for prime 13, so just assumed it was correct,
> >>  but obviously it isn't.
> > 
> > I really don't want to discourage you -- and I recognize
> > that everyone has to start somewhere -- but you really
> > need to improve your number theory game. Or just your
> > playing-around-with-equations game.
> > 
> > I believe you if you say you're not trolling, but part of the
> > reason that I thought you were trolling was that you had
> > missed a very elementary simplification, something like
> > combining 3*B + 2*B to get 5*B. It looked so obvious to me
> > (once I had re-written your formula) that I assumed you
> > were being intentionally obscure -- hence, trolling.
> > 
> > It's true that, the way you had written it, it was much harder
> > to see than that, but part of what you need to improve is
> > re-writing things to help you see such things.
> >     (see also: Whitespace Is Our Friend)
> > 
> > ----
> > I came up with what seemed to me a considerable simplificiation
> >     ( 6*EulerPhi(primorial(n-1)) - primorial(n-1) )*(x-1)
> >     =  4*primorial(n-1) - 2*primorial(n-2)
> > And you asked me how to solve it for x. I think you asked
> > for x = something. That is what I mean by "solve for x".
> > 
> > I can do that, and I will. But this is a good example to show
> > what I consider an essential technique for playing around with
> > equations. I don't know if this has an official name, but I
> > call it "chunking". One takes a big, messy part of an even
> > bigger, messier formula and replaces it with something
> > simple looking. You haven't really changed the formula,
> > because the simple-looking thing still represents the big,
> > messy thing.
> > 
> > Here, we can re-write
> >     ( 6*EulerPhi(primorial(n-1)) - primorial(n-1) )*(x-1)
> >     =  4*primorial(n-1) - 2*primorial(n-2)
> > as
> >     B*(x-1) = C
> > if we set
> >     B = ( 6*EulerPhi(primorial(n-1)) - primorial(n-1) )
> > and
> >     C = 4*primorial(n-1) - 2*primorial(n-2)
> > Then we can solve for x:
> >     x = 1 + C/B
> > and we can, if we wish, put the big messy things back:
> >     x =
> >        1 +
> >           ( 4*primorial(n-1) - 2*primorial(n-2) ) /
> >           ( 6*EulerPhi(primorial(n-1)) - primorial(n-1) )
> 
> Hi,
> 
> Thanks, I tested that equation you solved for x, and got this output:
> 
> n x
> 0 1.4
> 1 1.4
> 2 2.5
> 3 4.333
> 4 7
> 5 11
> 6 16.47
> 7 26.49
> 8 47.69
> 9 149.97
> 10 -210.85
> 11 -74.14
> 12 -46.48
> 13 -35.65
> 14 -29.53
> 15 -25.41
> ...
> 100 -7.014 (approx)
> 6400 -4.75 (approx)
> 6700 -4.73 (approx)
> 
> x slowly moves back towards 0, or else some
> limit close to -0 I guess, but it doesn't seem
> like it would go positive again.  Any ideas on what
> that means?  I had kind of expected x to just
> get larger.
> 
> cheers,
> Jamie
> 
> 
> 
> 
> 
> 
> 
> 
> > 
> > There might be further simplifications that can be made
> > at this point. Or not, I haven't looked.
> > 
> > Chunking gets much more valuable when the same big, messy
> > thing shows up more than once. This is something to keep
> > in mind when you're think about how to slice apart your
> > bigger, messier formula into chunks.
> > 
> > For example, in your
> > primorial(n) - 
> > (2*((EulerPhi(primorial(n)))+(EulerPhi(primorial(n))-(1/2*(primorial(n-1))))+(EulerPhi(primorial(n))-(primorial(n-1))))) 
> > = 2*primorial(n-2)
> > we could chunk
> > p(n) = primorial(n)
> > p(n-1) = primorial(n-1)
> > p(n-2) = primorial(n-2)
> > E(n) = EulerPhi(primorial(n))
> > and, doing nothing else, your formula gets much easier to
> > understand.
> > p(n) - (2*((E(n))+(E(n)-(1/2*(p(n-1))))+(E(n)-(p(n-1))))) = 2*p(n-2)
> > 
> > Of course, Whitespace is still Our Friend, though finding out
> > how to use whitespace to help _you_ see how something big and
> > messy is put together is something _you'll_ need to work out.
> > p(n) -
> > (
> >     2*(
> >        ( E(n) ) +
> >        ( E(n) - (1/2*(p(n-1))) ) +
> >        ( E(n) - (p(n-1)) )
> >       )
> > )
> > = 2*p(n-2)
> > 
> > ----
> > So:
> >     1. Whitespace Is Our Friend.
> >     2. Chunking Is Our Friend.
> > 
> > ----
> > Elsethread, Kevin Aylward made a joke
> >     (an old one, but a good one)
> > <KA>
> >     All odd numbers are prime:
> > 
> >     1 - yes
> >     3 - yes
> >     5 - yes
> >     7 - yes
> >     9 - no
> >     11 - yes
> >     13 - yes
> > 
> >     Thus proven. 9 was just an experimental error...
> > </KA>
> > 
> > The point of the joke is that we don't do "experimental
> > error" in math. If I say "all odd numbers are prime", I am
> > taken to mean *ALL* odd numbers are prime, without
> > exception. So, the thing said is definitely NOT proven.
> > 
> > The techniques that we use in order to be able to _say_
> > something _like_ "all odd numbers are prime" (but something
> > else, something correct) -- to say it and be correct without
> > exception -- are what most people refer to when they say
> > "mathematics".
> > 
> > Just checking some of *ALL* is not one of those techniques.
> > I think you can see why.
> >

check your work and Bill's. does (n-1) = (x-1) supposedly?  Can You "run" the formula of your original post to get a result for n and check compare with this one, please and thank you.  I very often miss the obvious as well. don't ask me to do it, i can't, obviously you can.  Bside why would I?

Back to sci.math | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 00:14 -0800
  Re: formula to calculate the nth prime Pubkeybreaker <pubkeybreaker@aol.com> - 2018-02-16 04:12 -0800
    Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 11:52 -0800
  Re: formula to calculate the nth prime Jim Burns <james.g.burns@att.net> - 2018-02-16 13:31 -0500
    Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 11:59 -0800
    Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 12:40 -0800
      Re: formula to calculate the nth prime Jim Burns <james.g.burns@att.net> - 2018-02-17 11:06 -0500
        Re: formula to calculate the nth prime Simon Roberts <retenshun@gmail.com> - 2018-02-17 08:34 -0800
          Re: formula to calculate the nth prime Simon Roberts <retenshun@gmail.com> - 2018-02-18 14:49 -0800
        Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-18 18:43 -0800
          Re: formula to calculate the nth prime Simon Roberts <retenshun@gmail.com> - 2018-02-18 19:02 -0800
        Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-18 20:37 -0800
          Re: formula to calculate the nth prime Simon Roberts <retenshun@gmail.com> - 2018-02-18 20:54 -0800
            Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-18 23:06 -0800
        Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-19 00:30 -0800
          Re: formula to calculate the nth prime Jim Burns <james.g.burns@att.net> - 2018-02-19 11:40 -0500
          Re: formula to calculate the nth prime Simon Roberts <retenshun@gmail.com> - 2018-02-19 08:55 -0800
            Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-20 22:30 -0800
    Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 13:06 -0800
      Re: formula to calculate the nth prime M Philbrook <jamie_ka1lpa@charter.net> - 2018-02-17 08:57 -0500
  Re: formula to calculate the nth prime "Kevin Aylward" <kevinRemovAT@kevinaylward.co.uk> - 2018-02-16 20:21 +0000
    Re: formula to calculate the nth prime Jamie M <jmorken@shaw.ca> - 2018-02-16 13:20 -0800

csiph-web