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


Groups > sci.electronics.design > #495915

Re: formula to calculate the nth prime

From Jamie M <jmorken@shaw.ca>
Newsgroups sci.electronics.design, sci.math
Subject Re: formula to calculate the nth prime
Date 2018-02-19 00:30 -0800
Organization Aioe.org NNTP Server
Message-ID <p6e1vu$4ui$1@gioia.aioe.org> (permalink)
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>

Cross-posted to 2 groups.

Show all headers | View raw


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) )
> 
> 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.
> 


Hi,

Could you solve this formula for x in Primorial[n]=2*3*5*7*11...*691*x ?

ie x as a prime larger than 691.


prime(n) = (Primorial[n] -
      (2*((EulerPhi[
            Primorial[n]]) + (EulerPhi[
             Primorial[n]] - (1/2*(Primorial[n - 1])))
          + (EulerPhi[Primorial[n]] - (Primorial[n - 1]))))) /
    (Primorial[n - 1] -
      (2*((EulerPhi[
            Primorial[n - 1]]) + (EulerPhi[
             Primorial[n - 1]] - (1/2*(Primorial[n - 2])))
          + (EulerPhi[Primorial[n - 1]] - (Primorial[n - 2])))));


cheers,
Jamie


Back to sci.electronics.design | 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 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 Jamie M <jmorken@shaw.ca> - 2018-02-18 18:43 -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 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 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 Long Hair <DecadentLinuxUserNumeroUno@decadentlinuxuser.org> - 2018-02-17 14:04 +0000
  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
      Re: formula to calculate the nth prime bill.sloman@ieee.org - 2018-02-17 16:25 -0800

csiph-web