View Single Post
Old 2017-02-03, 01:53   #66
 
gd_barnes's Avatar
 
"Gary"
May 2007
Overland Park, KS

2ยท5,839 Posts
Default

I think a large part of the problem is the project definition. Here is a complete project definition of what I think is needed:

General:

1. If k*b^n-1 can be written as 2^y-1; display a warning message on the screen that the form is a mersenne number and could better be factored or sieved with another program.

2. If k*b^n+1 can be written as x^y+1; and x, y > 1; display a warning message on the screen that the form is a GFN and could better be sieved with another program.

Remove all n cases:

1. If form is k^x*(b^y)^n-1; and x, y >= 2; and x, y == (0 mod 2); remove all n.

2. If form is k^x*(b^y)^n-1 or k^x*(b^y)^n+1; and x, y > 2; and [ x == (1 mod 2) -or- y == (1 mod 2) ]; and GCD of x, y > 1; remove all n.

Note that the -or- part here is important especially in a previously posted problematic case where x=3 and y=6. Only x meets the condition but that is sufficient. Here GCD of x, y = 3 so both are perfect cubes and should have all n's removed. In effect the -or- statement is a negation of the requirement from #1 where x, y == (0 mod 2).

3. If form is 4*k^x*(b^y)^n+1; and x, y == (0 mod 4); remove all n. These are Aurelian (spell) factors.

The above should all be checked first before preceding.

Remove partial n cases:

1. If form is k^x*(b^y)^n-1; and x==(0 mod 2); and GCD x, y = 1; remove all n == (0 mod 2).

2. If form is k^x*(b^y)^n-1 or k^x*(b^y)^n+1; and x > 2; and x==(1 mod 2) and GCD x, y = 1; let f(x) = the prime factors of x. For each f(x), remove all n == [ 0 mod f(x) ].

It is somewhat unlikely to have a k with more than one odd power > 2. The smallest example would be k=32768, which is 2^15. But we have such huge k's at CRUS that we have to go all the way with this. Hence all of the powers of the k must be determined and all of their algebraic factors removed. For k=32768 all n==(0 mod 3) and n==(0 mod 5) would be removed. Note: Srsieve already handles this correctly.

3. If form is 4*k^x*(b^y)^n+1; and x == (0 mod 4); and y not == (0 mod 4), remove all n == (0 mod 4).

4. If form is k^x*(2^y)^n+1; and x == (0 mod 4); and y == (2 mod 4); remove all n == (1 mod 4).

5. If form is k^x*(2^y)^n+1; and x == (0 mod 4); and y == (1 mod 2); remove all n == (2 mod 4).

#3, 4, and 5 are more Aurelian factors.

Coordination with existing code:

1. If all n's are removed by algebraic factors for all k, program should stop immediately.

2. If some n's are removed by algebraic factors, program continues sieving for numeric factors.

3. Program should be able to handle input of one or multiple k's for a new base at the screen or in a file. Some k's could have algebraic factors while others do not. This could include BOTH Riesel and Sierp k's for the same base in the same file.

4. Program should be able to handle an already sieved file as input, check the file for algebraic factors, remove them, and then continue sieving more deeply. Once again some k's could have algebraic factors while others do not and there could be both Riesel and Sierp k's in the file for the same base.

Note that the requirement for being able to handle both Riesel and Sierp k's in the same file is important. Usually a -G or -g format file is fed into srsieve but it can also handle the -a or -w format as input, which could include k's on both sides.

Note that the above is complex. I've tried to cover all of the cases but it is possible that there may be a logic error in there. Any input is welcome from anyone. Mark, I suspect that it may be easier for you to strip out all current algebraic factors code and start from scratch with this project definition. I think it will result in a lot less work than trying to make the current code fit this definition.

Good luck!

Last fiddled with by gd_barnes on 2017-02-04 at 20:54
gd_barnes is offline   Reply With Quote