20110630, 23:16  #1 
Jun 2011
Henlopen Acres, Delaware
7×19 Posts 
Primes in a spreadsheet
When searching around for a soft copy of primes on the internet, pickings are surprisingly scarce. You come across text lists with no particular alignment specifications and comma separated lists with other info embedded, so there's a bunch a data cleansing that needs to be done.
Does anyone have an Excel spreadsheet with just one column with a bunch of primes, one in each row? 
20110630, 23:49  #2 
Dec 2010
Monticello
703_{16} Posts 
See Here:
http://www.mersenneforum.org/showthread.php?t=15705 Since you aren't (yet) interested in particularly large primes, the very basic 10line program being discussed there should work fine for you, and you can ask it for any alignment you like. Just import the result into your spreadsheet. And be careful not to overwhelm the spreadsheet; there are 60,000 or so primes under 10^6. 
20110701, 00:44  #3 
Oct 2007
Manchester, UK
2×5×137 Posts 
Here's some more basic code for Pari/gp:
Code:
\\default(primelimit,10^7); \\ The default is only 500,000. Maximum value is 4,294,965,247. Uncomment the start of the line and set appropriately as needed. output_file="C:/primes.csv"; \\ Where do you want your primes? start_prime=2; \\ Does not need to be prime, it will start from the first prime after this value. end_prime=10^3; \\ Also does not need to be prime, it will stop at the last prime before this value. { forprime(p=start_prime,end_prime, write(output_file,p); ); } Code:
\r drive:/path/to/file.txt You can download Pari/gp from here. 
20110701, 00:46  #4 
6809 > 6502
"""""""""""""""""""
Aug 2003
101×103 Posts
24626_{8} Posts 
There are some prime generators around. Some are allow you to pick a starting point and the number to generate. FWIW, it will be faster to generate them than to have excel save them.
here is one simple one: http://javaboutique.internet.com/prime_numb/ Last fiddled with by Uncwilly on 20110701 at 00:50 
20110701, 04:10  #5 
Aug 2006
13535_{8} Posts 
I'll add another vote for PARI/GP (make sure to download the "Windows binary" if you're running Windows). Here's how I'd code it:
Code:
makePrimes(howMany, file)={ if(default(primelimit) < howMany, default(primelimit, howMany)); forprime(p=2,howMany,write(file, p)) }; makePrimes(100000, "c:/location.csv") 
20110701, 11:33  #6  
"Forget I exist"
Jul 2009
Dumbassville
2^{3}×1,049 Posts 
Quote:


20110701, 17:55  #7 
Oct 2007
Manchester, UK
10101011010_{2} Posts 

20110701, 22:00  #8 
"Forget I exist"
Jul 2009
Dumbassville
2^{3}×1,049 Posts 

20110701, 23:31  #9 
"Richard B. Woods"
Aug 2002
Wisconsin USA
17014_{8} Posts 

20110701, 23:47  #10 
"Forget I exist"
Jul 2009
Dumbassville
20310_{8} Posts 

20110701, 23:51  #11 
"Forget I exist"
Jul 2009
Dumbassville
2^{3}×1,049 Posts 
doesn't work at last check. took out one thing first to try. I still haven't found a way that seems to work.
Last fiddled with by science_man_88 on 20110701 at 23:53 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Mersenne Primes p which are in a set of twin primes is finite?  carpetpool  Miscellaneous Math  4  20220714 02:29 
Distribution of Mersenne primes before and after couples of primes found  emily  Math  34  20170716 18:44 
Conjecture about Mersenne primes and nonprimes v2  Mickey1  Miscellaneous Math  1  20130530 12:32 
A conjecture about Mersenne primes and nonprimes  Unregistered  Information & Answers  0  20110131 15:41 
possible primes (real primes & poss.prime products)  troels munkner  Miscellaneous Math  4  20060602 08:35 