Thursday, September 12, 2019

proth research - directories and more directories

After several years of working with Proth numbers, looking for interesting properties, a filesystem will get pretty packed!








How do I organise directories in a mass of say 500 or 1000 directories? Starting off with fixed so prothleadNNNNNN (Example: prothlead8388607)

If/when I find something interesting, and think its worth generalising, then I just replace the NNNNNN number with a short sequence of characters.
They have no meaning generally, just a way of making things stand out in a mass of directories.

What you can see from the final image 'prSAL' is how I labelled the prothlead8388607 directories after I generalised away from just the t=23 case. It helped to quickly think up something short - just a way of less typing at the time.

I could still be writing prothlead8388607 today but it just felt like too much and so i found a shorter thing that just occurred to me at the time. ( pretty arbitrary )

I could keep posting screenshots until I had 10 images on screen here to show the problem in hunting around in Proth numbers over a period of 7 years and keeping things organised in directories!


Sunday, June 23, 2019

pari operation time - Miller Rabin

Setting 1 in the call to ispseudoprime() in Pari/GP will get you a strong pseudoprime test (Miller-Rabin)

Pseudoprime tests are more practical first attempts when dealing with huge inputs ( In this example the number has 632202 decimal digits )

How long did the operation take? ## shows 13 hours 58 minutes




Link and further reading:


Thursday, June 13, 2019

ABC and ABCDN formats for input to LLR and PFGW - numeric construction

With the creation of organised projects for prime number searching, and the retirement of some of the leading C program creators, the knowledge about ABC and ABCDN format is harder to find.

Here I gather a few links (see references) and show a source code sample that will help point you in the right direction.



LLR is great for standard formats (commonly mined prime areas) and is able to cope with many different formats, however where you differ from some of the more common +1 and -1 forms, the following warning is given in the program readme:
- K*b^n+c numbers with |c| < > 1 or k > b^n can only be PRP tested.

If the number is found PRP, the % of factorization is then shown,
     but note that it is relevant only if c == +1 or -1...


References and links:
  • LLR implements "Lucas-Lehmer-Riesel" and Proth algorithms - source
  • OpenPFGW - source
  • OpenPFGW page about ABC and ABC2 and ABCD - text
  • Caldwell pages at University of Tennesse at Martin - program links

Saturday, September 2, 2017

High performance [mathematical] computing

When talking about supercomputers, there is a temptation to define things in terms of either of the following:
  1. massive simulations 
  2. they mean maths
Here is a phrase used in a recent discussion about high performance computing (hpc) that points to the first definition for my mind ...
The term number-crunching refers to large-scale numerical simulations
Now simulations of spacecraft flight or the effects of adding a dam to a major river really are typical uses of hpc

However, thinking about (2 ... they mean maths), you have many uses of hpc where the Mathematics itself is the outcome.

For people who are learners of hpc, I can see why the 'massive simulations' message is preferred as a way of presenting the utility of hpc

However as a Mathematician I naturally think also of many scenarios where the Mathematics is the outcome.

Not all of those outcomes will be moved onto a powerful workstation in the next decade.

There is also another major use of hpc which is not really [in my opinion] a good fit for the word simulation. Natural language processing at very high speed is one of the prerequisites of AI.

In such a context you are not simulating the process of adding meaning to raw words, you are actually doing it when you task a hpc with such processing.

Tuesday, February 14, 2017

shifting from m1q 898739...000591

Here is a fun loop for you to code up in Pari/GP and examine the output

m1q=89873960570712084732829528260849073549900665278240478747684257744366000579315782083148000591

for(k=9000,10000,n=m1q+2+3*k;n6=n%6;prim=0;if(0==n6,prim=isprime(n/6));print("k=",k," gives ",prim,"=isprime(n/6)");if(prim>0,break))

Sample output for loop starting k=9000

k=9000 gives 0=isprime(n/6)
k=9001 gives 0=isprime(n/6)
 ...
k=9250 gives 0=isprime(n/6)
k=9251 gives 1=isprime(n/6)

Here is a slightly improved loop:

for(k=9000,10000,n=m1q+2+3*k;n6=n%6;prim=0;if(0==n6,print("k=",k," 0==n/6");prim=isprime(n/6));print(" gives ",prim,"=isprime(n/6)");if(prim>0,break))

k=9249
 0==n/6
 gives 0=isprime(n/6)
 gives 0=isprime(n/6)
k=9251 0==n/6
 gives 1=isprime(n/6)


m1q is prime and has the following construction:

t=193;m1=((-1+(3^(t))*37));m1q=m1/50

Monday, February 8, 2016

primes and quadratic involving deduction of 2

Take a prime p and double it then deduct 5 to obtain 2p5

candidate = -2+p*2p5

Is candidate prime?

Example p=53 so 2p5 =101

5351=-2+53*101
5351 is prime

Next try p=47 so 2p5 = 89

4181=-2+47*89
4181=37*113


Next try p=59 so 2p5 = 113

6665=-2+59*113
6665=5*31*43

Next try p=61 so 2p5 = 117

7135=-2+61*117
7135=5*1427


Next try 67 so 2p5 = 129

8641 is prime

Now algebraically we might say -2+p*(2p-5) which is rewritten 2p^2-5p-2

Next try 71 so 2p5 = 137

9725=-2+71*137
9725=5*5*389


Next try 73 so 2p5 = 141

10291=-2+73*141
10291=41*251

Next try 79 so 2p5 = 153

12085=-2+79*153
12085=5*2417

Next try 83 so 2p5 = 161

13361=-2+83*161
13361=31*431

Next try 89 so 2p5 = 173

15395=-2+89*173
15395=5*3079


Next try 97 so 2p5 = 189

18331=-2+97*189
18331=23*797

Next try 101 so 2p5 = 197

=-2+101*197
=5*23*173


Next try 103 so 2p5 = 201

20701=-2+103*201
20701=127*163 is composite


Next try 107 so 2p5 = 209

22361=-2+107*209
22361=59*379 is composite


Next try 109 so 2p5 = 213

23215=-2+109*213
23215=5*4643 is 5 divisible



Next try 113 so 2p5 = 221

24971=-2+113*221
24971 is prime


Answer will be divisible by 5 when -2+2p^2 is divisible by 5
( or written another way answer cannot be divisible by 5 when -2+2p^2 is not divisible by 5 )


Now we redo the above example but with slightly different assignment for p

Set the prime 113 then deduct a 100 and use that figure as p

13 is prime
p=13

113=p+10^2

221 = p*(p+4)

-2+(p+(2*5)^2)*p*(p+4)


prime 24971==-2+113*221            ( 221 is 13*17 )


p=17

 -2+(p+(2*5)^2)*p*(p+4)

41767=-2+117*17*21
41767=11*3797


p=19

-2+(p+(2*5)^2)*p*(p+4)
51201=-2+(7*17)*(19*23)
51201=149*349


p=1053 so p+100 is 1053
p2=1053

prime 1283313211==-2+1153*(1053*1057)

( 1283313213==(3^4)*7*13*151*1153 )


Now let us vary things slightly by defining p2=p+100 and having our answer derived as -2+(p2^2)*(p2+4)

p=953 which is prime and then p+100 is 1053
p2=1053

prime 1172011111==-2+1053*(1053*1057)

( 1172011113==(3^8)*7*(13^2)*151 )







Tuesday, September 10, 2013

sagemath terminal colours - green > blue

Sagemath includes an embedded version of ipython and any changes you make to terminal colours need to happen in ipython_config.py in the correct place.

After doing a sage install there is a directory on my computer at location:
~/.sage/ipython-0.12/

The goal of this short set of hints is to assist you in creating a suitable profile_sage/ipython_config.py file.

That file should look like this:

# Configuration file for ipython.

c = get_config()

# Set the color scheme (NoColor, Linux, or LightBG).                                                                    
c.TerminalInteractiveShell.colors = 'Linux'

What that will achieve is to make your prompt green instead of blue.
The default (blue) seems a little bright on the eyes, so by setting colors = 'Linux' you get the less garish green prompt instead.

You can just run ahead and use geany or another editor to create ipython_config.py with content detailed above.

If you prefer to look at what iPython itself generates then you might wish to know of these two commands:
  • ipython profile list
  • ipython profile create justcreatedbyme
However be aware that you want to be running the embedded ipython version when doing 'profile create' in order to be sure a a fully compatible profile is created.
( Manual copy / rename things to get file to proper location of
profile_sage/ipython_config.py )

An example of the output from profile list is shown below:

List of profiles available to iPython