tables of p(n) and/or pi(n) / tables of primes

cino hilliard hillcino368 at hotmail.com
Mon Sep 19 12:53:56 CEST 2005


Hi David et al,

>Would it be possible for me to get a hold of extended tables for p(n) 
>and/or pi(n), with a view toward extending certain sequences related to 
>these functions?

You may want to purchase a windows macro program such as the one in
http://www.tethyssolutions.com/

I used this program to extract 30,000 Pi(x) entries, x in increments of 1 
billion in a few hours using
The N'th prime page and an excel spread sheet. I have published a text file 
of this at

http://groups.msn.com/Primeslessthanorequaltox/documents.msnw.

The motivation for all this was to investigate R(x) and Li(x).  The excel 
workbook is 26 megabytes.

The macro recorder is sensitive and a real pain and you have to edit the 
script. Also you have to
save your windows sizes and give enough delay at the point the N-th Prime 
database does the
look-up. 2000 or so ms. Once you have it working, you can change your 
increment and range.

It would be nice if Andrew Booker would make his database downloadable in 
parts for ranges of
lookup or introduce a Pi(x) only page.

I have computed and stored all primes < 100 billion in a 45 gig file. I used 
a sieve up to 72 billion
and the Pari ispseudoprime 72 to 100 billion. There is a oneway street here 
as we can write as big a
file as we want (up to hd memory) but reading is another matter for most 
languages which are
limited to the 4 gig limit. Fortunately, PowerBasic will address long long 
and I have an open.dll file
with  XOPEN, XSEEK, XGET, XPUT that can be called from c and other 
languages.  I looked at
PFGW and don't think I can modify it to do this.

I am currently doing 100 bill to 200 bill. the Pari write() nicely 
concatenates the primes with my fixed record length of 11 (same as first 100 
bill). I will add the leading 1 with if's in the hugeread.

Reading a file is much faster than Pari prime(x) and much more powerful. 
Actually, I have added
the file to a function in pari: prime2(x). Recall XSEEK is direct access to 
the the data.

prime2(n) =    \\ the nth prime using f:\sieve\prime.exe calling 
ztest2-100.txt the
                     \\ 4118054813  primes < 100 billl.
              {
              local(x,s);
              s=concat("f:/sieve/prime ",Str(n));
              s=concat(s," > temp.txt");          \\Must save to a temp file 
for correct output
              system(s);
              return(read("temp.txt"))  \\ no temp woud mean a faster read.
              }

Prime.exe is a c program that calls f:\sieve\ztest2-100.txt the  4118054813 
primes < 100e9.
My thinking is to ust my base conversion program to convert the 11 byte 
records from base 10 to
base 255.  11 digits reduce to 5 characters base 10 to base 255. So we 
reduce our file to 45%
of the origional. An by doing 3 records at a time we get base 10 to 255 33 
digits to 14 char or 42%
of the origional. So we go from 45 gig to 19 gig. Then for the primes < 1e12 
we need roughly
19*10 = 190 gig hd space. If I new how, I would set up my f; drive as a 
drive that could be read
from the internet. Now days more folks are getting broadband and dsl so 
something like this is
feasable. You quickly download the compressed data and convert quickly with 
your cpu.
I know of no one else using base conversion as a data compression engine. 
The compression of
numbers rivels anything out there.

Moreover,base conversion can be used as a encryption scheme since we can 
greatly vary the order
of the ascii set in our calculation. Ie., numbers first in this case as 
opposed to 48,49,...in the normal
ascii order. And we can alter the output ever so slightly to jumble the 
results.

489434577740787141528222192463629593922
This is  "No man is an island." in base 92 to base 10.
By flipping the outer 4 and 2 and converting base 10 to 92 we get
EAQ7C2o=EP/N9F#j8xA(

Maybe a group effort would speed things up in this endeavor. Surely I will 
come up with a sequence
in all this research.:-)

Have fun,
Cino







More information about the SeqFan mailing list