Skip to main content
deleted 21 characters in body
Source Link
poncho
  • 150.6k
  • 11
  • 230
  • 369

Does anyone know if it is a known method that can be attributed to some paper?

Dunno. I remember doing this circa 25 years ago (and I didn't read it anywhere); it's quite likely that multiple people made the same observation independently.

In the code, there is a limit on the maximum increment, after which a new prime is sampled and residues recalculated.

I can think of two reasons:

  • They just don't trust the math that says that $ai+b$ will always eventually be prime for some $i$ (as long as $a, b$ are relatively prime); or

  • They're worried about potential bugs which might cause an infinite loop (e.g. if $a, b$ aren't relatively prime, this will infinite loop - impossible ifalthough, because they use $a=2$ and $b$ is selected odd; conceivable ifassuming they use some other strategy to selectalways pick the starting point $a, b$$b$ odd, this cannot happen)

Does anyone know if it is a known method that can be attributed to some paper?

Dunno. I remember doing this circa 25 years ago (and I didn't read it anywhere); it's quite likely that multiple people made the same observation independently.

In the code, there is a limit on the maximum increment, after which a new prime is sampled and residues recalculated.

I can think of two reasons:

  • They just don't trust the math that says that $ai+b$ will always eventually be prime for some $i$ (as long as $a, b$ are relatively prime); or

  • They're worried about potential bugs which might cause an infinite loop (e.g. if $a, b$ aren't relatively prime, this will infinite loop - impossible if $a=2$ and $b$ is selected odd; conceivable if they use some other strategy to select $a, b$)

Does anyone know if it is a known method that can be attributed to some paper?

Dunno. I remember doing this circa 25 years ago (and I didn't read it anywhere); it's quite likely that multiple people made the same observation independently.

In the code, there is a limit on the maximum increment, after which a new prime is sampled and residues recalculated.

I can think of two reasons:

  • They just don't trust the math that says that $ai+b$ will always eventually be prime for some $i$ (as long as $a, b$ are relatively prime); or

  • They're worried about potential bugs which might cause an infinite loop (e.g. if $a, b$ aren't relatively prime - although, because they use $a=2$ and assuming they always pick the starting point $b$ odd, this cannot happen)

Source Link
poncho
  • 150.6k
  • 11
  • 230
  • 369

Does anyone know if it is a known method that can be attributed to some paper?

Dunno. I remember doing this circa 25 years ago (and I didn't read it anywhere); it's quite likely that multiple people made the same observation independently.

In the code, there is a limit on the maximum increment, after which a new prime is sampled and residues recalculated.

I can think of two reasons:

  • They just don't trust the math that says that $ai+b$ will always eventually be prime for some $i$ (as long as $a, b$ are relatively prime); or

  • They're worried about potential bugs which might cause an infinite loop (e.g. if $a, b$ aren't relatively prime, this will infinite loop - impossible if $a=2$ and $b$ is selected odd; conceivable if they use some other strategy to select $a, b$)