Created
          February 3, 2013 22:52 
        
      - 
      
- 
        Save dfilimon/4704091 to your computer and use it in GitHub Desktop. 
    Number of primes less or equal to n vs n
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library('gmp') | |
| primes <- data.frame(1:1000000) | |
| names(primes) <- 'nums' | |
| primes$isprime <- isprime(primes$nums) | |
| pn <- primes[primes$isprime == 2, 'nums'] | |
| e <- ecdf(pn) | |
| plot(e, xlab='n', ylab='Number of primes less or equal to n') | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment