cino hilliard on Sun, 24 Sep 2006 15:01:11 +0200

 Re: PrimeLimit

```

```
```From: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
To: pari-users@list.cr.yp.to
Subject: Re: PrimeLimit
Date: Fri, 22 Sep 2006 14:40:44 +0200

* Tautócrona [2006-09-20 15:20]:
> I usually work with primes in Pari-GP, and find the PrimeLimit
> parameter very small for my purposes. I know that with the command
> Default(PrimeLimit, N) I can make PrimeLimit as big as N, but N ~
> 4*10^9 seems to be the final limit.
```
```
```
```(11:22) gp > default(primelimit,2^31)
time = 14,648 ms.
(11:22) gp > gettime(); for (i=25,31, forprime(p=2,2^i,); print(gettime()))
60
124
228
444
845
1629
3140

Nicely linear in forprime's upper bound...
```
```
The log of these is nicely linear.
1.77815125
2.093421685
2.357934847
2.64738297
2.926856709
3.211921084
3.496929648

```
You store the prime differences in the gp environment. Do you keep a running prime every so
```often to increment from or do you just add up the differences?

```
I have beat the prime limit problem from the standpoint of prime(x) by using a sieve program to store the 37,607,912,018 primes less than a trillion in binary format which requires 301 gigs of file space. Then I call a prime c program that reads this file with a prime2 routine in Pari.
```
```
prime2(n) = \\ the nth prime using f:\sieve\primeapigcc.exe calling prime2-1000bill.bin
```             {
local(x,s);
s=concat("f:/sieve/primeapigcc ",Str(n));
```
s=concat(s," > temp.txt"); \\Must save to a temp file for correct output
```             system(s);
}

For example.
(16:43:03) gp > prime2(37607912018)
%40 = 999999999989

```
The sieve program takes about 1/2 a day to store. I would like to use a difference scheme to store many more primes in a lot less space. I guess the problem here will be speed again.
```
```
My guess that the ith prime for every million primes could be stored in a seperate file with a value indication the record of the difference file. The we just add from that point.
```
This would reduce the file considerabley or allow a whole bunch more primes.

Enjoy,
Cino Hilliard,

```

• References:
• Re: PrimeLimit
• From: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.831989586353302, "perplexity": 2849.0041401758763}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-30/segments/1500549426050.2/warc/CC-MAIN-20170726062224-20170726082224-00467.warc.gz"}