Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

weily's blog

By weily, history, 5 hours ago, In English

Upd: the first 8 primes are not enough, because $$$341550071728321 = 10670053 \times 32010157$$$ (for hacker).

===

Hi everyone,

Generally speaking, using the sequence (2, 325, 9375, 28178, 450775, 9780504, 1795265022) as bases in the Miller-Rabin primality test is sufficient to check prime numbers below $$$2^{64}$$$.

However, this sequence is quite hard to remember. Some sources suggest using the first 12 prime numbers as bases, while others claim that the first 8 primes are enough. Unfortunately, these claims lack clear references.

I'm curious about the minimum number of $$$n$$$ if we use the first $$$n$$$ prime numbers as bases for testing primality below $$$2^{64}$$$.

Does anyone know a definitive answer or a reliable source for this?

Thank you!

English is not my native language; please excuse typing errors.

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
4 hours ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

[DELETED] My previous thoughts were wrong.

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by weily (previous revision, new revision, compare).

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Maybe the first 8 primes is for $$$2^{32}$$$? I'm not sure.

»
104 minutes ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

$$$3825123056546413051 = 149491 \times 747451 \times 34233211$$$, which is a stronger pseudoprime.

Now I know the first 12 prime numbers is necessary.

Thank You!

===

upd:

Strong Pseudoprimes:

  • 341550071728321
  • 84983557412237221
  • 230245660726188031
  • 1134931906634489281
  • 1144336081150073701
  • 1167748053436849501
  • 1646697619851137101
  • 3825123056546413051
  • 4265186605968234451
  • 5474093792130026911
  • 7033671664103127781
  • 7361235187296010651
  • 8276442534101054431
  • 14688059738864848381
  • 16043083915816662841