![]() |
|
|
#1 |
|
Jun 2011
Henlopen Acres, Delaware
7·19 Posts |
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? |
|
|
|
|
|
#2 |
|
Dec 2010
Monticello
5·359 Posts |
See Here:
http://www.mersenneforum.org/showthread.php?t=15705 Since you aren't (yet) interested in particularly large primes, the very basic 10-line 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. |
|
|
|
|
|
#3 |
|
Oct 2007
Manchester, UK
135710 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. |
|
|
|
|
|
#4 |
|
6809 > 6502
"""""""""""""""""""
Aug 2003
101×103 Posts
22×23×107 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 2011-07-01 at 00:50 |
|
|
|
|
|
#5 |
|
Aug 2006
175B16 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")
|
|
|
|
|
|
#6 | |
|
"Forget I exist"
Jul 2009
Dumbassville
838410 Posts |
Quote:
|
|
|
|
|
|
|
#7 |
|
Oct 2007
Manchester, UK
23·59 Posts |
|
|
|
|
|
|
#8 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
|
|
|
|
|
|
#9 |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
22·3·641 Posts |
|
|
|
|
|
|
#10 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
|
|
|
|
|
|
#11 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 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 2011-07-01 at 23:53 |
|
|
|
![]() |
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 | 3 | 2017-08-10 13:47 |
| Distribution of Mersenne primes before and after couples of primes found | emily | Math | 34 | 2017-07-16 18:44 |
| Conjecture about Mersenne primes and non-primes v2 | Mickey1 | Miscellaneous Math | 1 | 2013-05-30 12:32 |
| A conjecture about Mersenne primes and non-primes | Unregistered | Information & Answers | 0 | 2011-01-31 15:41 |
| possible primes (real primes & poss.prime products) | troels munkner | Miscellaneous Math | 4 | 2006-06-02 08:35 |