Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Generating prime numbers in R
# Prime number generator in R Limit<-5000 # All prime numbers >3 are of the form 6*n+1 or 6*n-1, so we only need to check these numbers primeslist<-c(2,3) # List were we store the primes list<-c() # list were we store the numbers to check k<-1 x<-6*k+1 while (x <= Limit) { list<-c(list,x-2,x) k<-k+1 x<-6*k+1 } while(!length(list)==0) { y<-min(list) primeslist<-c(primeslist,y) list<-setdiff(list,list[list %% y==0]) } primeslist
run
|
edit
|
history
|
help
0
03-08-2020-Derivada-Numerica
Which one is which !
Mandelbrot 2
test1
Multiple Regression and Binomial Regression Sample
Not able to install packages
helloworld
,k
As1-1
Flower boxplot