Counting bases to which numbers are pseudoprime

474 Views Asked by At

Let $n=p_1^{a_1}\cdots p_k^{a_k}$ be an odd composite. Then the number of bases $1\le b\le n-1$ for which n is a strong pseudoprime is

$$ \left(1 + \frac{2^{k\nu}-1}{2^k-1}\right) \prod_{i=1}^k\gcd\left(n^*,\ p_i^*\right) $$

where $v_2(x)$ is the largest e such that $2^e|x-1$ and $\nu$ is the minimum of $v_2(p_i)$ over all the $p_i$, and $x^*$ is the largest odd divisor of $x-1$.

1. What is the analogous formula for pseudoprimes? I've seen it but misplaced the reference.

2. What is the original source of this formula? I've never seen an attribution, it's always stated as folk knowledge. Does it date back to the time of Fermat?

3. Similarly, what is the source of the formula above for strong pseudoprimes?

1

There are 1 best solutions below

0
On

Baillie and Wagstaff give a formula for counting the number of bases a number is pseudoprime to. Given a prime factorization $n=\prod\limits_{k}p_k^{a_k}$, the number of bases $< n$ for which $n$ is a pseudoprime is given by

$$\prod_k \gcd(n-1,p_k-1)$$

I have no idea if this has previously appeared before the Baillie-Wagstaff paper, though.