Loading ...
Sorry, an error occurred while loading the content.

new nth prime correct

Expand Messages
  • Sebastian Martin
    Hello all: I send you a new formula (In MATHEMATICA) for the nth prime number L[1]=1; L[n_]:=L[n]=LCM[L[n-1],n] LG[n_]:=L[n]/L[n-1] FL[n_]:=Quotient[LG[n],n]
    Message 1 of 1 , Apr 1 10:01 AM
    View Source
    • 0 Attachment
      Hello all:

      I send you a new formula (In MATHEMATICA) for the nth
      prime number

      L[1]=1;
      L[n_]:=L[n]=LCM[L[n-1],n]
      LG[n_]:=L[n]/L[n-1]
      FL[n_]:=Quotient[LG[n],n]
      Pii[n_ ]:=Sum[FL[i],{i,2,n}]
      PrimeLCM[n_]:=
      Floor[n*Log[n]]+Sum[1-Quotient[Pii[k],n],

      {k,Floor[n*Log[n]],Floor[n*Log[n]+n*(Log[Log[n]]-1/2)+3]}]
      Do[Print[n," ",Timing[PrimeLCM[n]]],{n,2,20,1}]

      more fast than the previous:
      www.primepuzzles.net problem 38

      Te time of the previous formula is O(nlogn)^(3/2)
      Which is the time of this new formula?

      Sincerely

      Sebastián Martín Ruiz
      www.telefonica.net/c/smruiz


      ___________________________________________________
      Yahoo! Messenger - Nueva versión GRATIS
      Super Webcam, voz, caritas animadas, y más...
      http://messenger.yahoo.es
    Your message has been successfully submitted and would be delivered to recipients shortly.