Post Reply 
Strange behaviour of prime numbers
05-28-2019, 05:56 AM (This post was last modified: 05-28-2019 09:25 AM by Gilles.)
Post: #28
RE: Strange behaviour of prime numbers
(05-27-2019 10:53 PM)Albert Chan Wrote:  
(05-27-2019 09:35 PM)Gilles Wrote:  I'm probably wrong somewhere ...

Hi, Gilles

I don't think your code counted 1 million primes, but only primes below 1 million.
In other words, only PrimePi[10^6] = 78498 primes.

Tried lastdigitdist[Range[78498]], and it matches above posted distribution.

You are right Albert ! Code must be :
Code:
«
  1 2 0 9 IDN 0 *  →  nbp prev new stat
  «
    2
    WHILE NEXTPRIME 'nbp' INCR 1E6 < REPEAT
     DUP 0 0 DIGITS 'new' STO
     'stat' prev new 2 →LIST DUP2 GET 1 + PUT
     new 'prev' STO
    END
    stat nbp / 100 *
  »
»

Same resuts as yours in 28,5 sec on my PC
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Strange behaviour of prime numbers - Gilles - 05-28-2019 05:56 AM



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