0

Finding (P,P+2) Primes in R, I tried like this

twinPrimes(1,100)
     [,1] [,2]
[1,]    3    5
[2,]    5    7
[3,]   11   13
[4,]   17   19
[5,]   29   31
[6,]   41   43
[7,]   59   61
[8,]   71   73

I got the answer. But this command will work only upto finding 100000 after that also I'm getting the answer but still some error like this

[ reached getOption("max.print") -- omitted 3169 rows ]

How to avoid this?

Aarthika
  • 101
  • 11
  • I would think the phrase "twin primes" would be a little more readable (at least to non-mathematicians) than `(p,p+2)` since that is, after all, the definition of twin prime. – paxdiablo Sep 14 '15 at 06:46
  • You can set a higher value for `max.print` from `option` in this way `options(max.print = 10^9)`. – Frash Sep 14 '15 at 06:48
  • This is not an error. You just reached the limit of display. –  Sep 14 '15 at 06:51
  • This is only a matter of output display, and not of the data that his calculated. As mentioned above you can change the output settings. Or you can split the calculation into chunks, using , e.g., `numbers::twinPrimes(100000,200000)`. – RHertel Sep 14 '15 at 06:52
  • Another option would be to store the result to a file with `write.table` and then use a text editor or a spread sheet program to look at the data. – Stibu Sep 14 '15 at 06:54

0 Answers0