Quote:
Originally Posted by R. Gerbicz
I'm not sure what your code is doing
|
Sorry, I meant to reply to this earlier but somehow slipped my mind.
Anyway, the code computes a cost function of including p^n in the product. It is basically log(p) (i.e proportional to the bits) / probability of p^n dividing a random P-1. i.e. more bits = costlier. Less probable = less useful. This comes out as log(p) * (p-1) * p^(n-1) -> what I call as the merit function.
The code then finds the largest n for each p such that merit(p^n) doesn't exceed the target merit, which is just the cost for a single instance of the largest prime under B1. For comparison, it also prints the count as per the regular method.