A Special Property of 151

```In the field of real numbers the exponential function exp(x) is
the sum of the quantities  (x^k)/k!  for k ranging over all the
distinct non-negative integers.  In the finite field of integers
modulo a prime p we can define the analagous function where k ranges
over all the distinct non-negative residues.  In other words, given
any prime p, and letting LNNR[x] denote the least non-negative
residue of x modulo p, we define the function
_                                           _
|                x^2     x^3        x^(p-1)   |
a(x) =  LNNR|  1  +   x   +  ---  +  ---...  +  -------   |
|_                2!      3!         (p-1)!  _|

This function involves divisions (mod p), so it would be tricky to
evaluate if the modulus p was composite.  However, the companion
function

b(x) =  LNNR[ 1 + (1!)x + (2!)x^2 + (3!)x^3 + ... ((p-1)!)x^(p-1) ]

can be easily computed for any modulus p, prime or composite.  Also,
it turns out that
a(x) = -b(-1/x)     (mod p)

for any prime p and any x not congruent to zero (mod p).  Thus, for
any integer modulus we can simply define a(x) to be LNNR[-b(-1/x)] for
all non-zero x, and of course a(0)=1.

If, for a given prime modulus p, we let A(p) denote the sum of the
values of a(x) for x = 0 to p-1, and similarly let B(p) denote the sum
of all the values of b(x), then we find that

A(p) = B(p) = 1  (mod p)

We can also consider the values of p for which the absolute sums A(p)
and B(p) are equal.  The only primes less than 1000 with this property
are
2, 3, 17, 23, 43, 71, 109, 337, 769, 853, 919

Anyway, for a given modulus m let z(m) denote the number of "zeros"
of a(x).  In other words, z(m) is the number of distinct values of
x for which a(x)=0.  I think z(m) is multiplicative, i.e., if
gcd(r,s)=1 then z(rs)=z(r)z(s).  For this reason we need only
consider the values of z(p) for primes p.  It appears that
z(p^k) = z(p)  for all exponents k.  The values of z(p) for
the first several primes are

p  z(p)       p  z(p)       p   z(p)       p   z(p)

2   1        53   3        127   0        199   3
3   0        59   1        131   1        211   0
5   1        61   0        137   0        223   2
7   1        67   1        139   1        227   1
11   1        71   2        149   0        229   3
13   2        73   1        151   5        233   3
17   0        79   1        157   0        239   2
19   1        83   1        163   2        241   2
23   0        89   2        167   4        251   0
29   0        97   4        173   1        257   0
31   1       101   2        179   0        263   1
37   4       103   1        181   1        269   0
41   1       107   0        191   3        271   0
43   2       109   0        193   2        277   0
47   2       113   0        197   1        281   0

Notice that z(151)=5.  This is the only prime p less than 1000 such
that z(p) is greater than 4.  For the 168 primes less than 1000 the
values of z(p) are distributed as follows

z(p)
0   1   2   3   4   5
--- --- --- --- --- ---
# of primes      54  60  40   9   4   1

Does anyone know the asymptotic distribution over all primes?  Is
there a prime with 6 zeros?  Letting z(p) denote the number of
distinct solutions of

x^2     x^3        x^(p-1)
1  +   x   +  ---  +  ---...  +  -------   =   0    (mod p)
2!      3!         (p-1)!

does there exist a prime p such that z(p)=n for any given n?

I've checked up to 6863 and the only primes in this range (other than
151) with more than four roots are 5209 and 5653, each of which has
five roots.  (I note in passing that 5209 = -1/2  (mod 151), and
5653 = -1/16  (mod 151).)  There is no prime in this range with more
than five roots.

As for the asymptotic distribution, it appears (not surprisingly) to
be Poisson with expected value of 1.  The values of z(p) for the 883
primes up to 6863 are distributed as follows

0     1     2     3     4     5     6
---   ---   ---   ---   ---   ---   ---
Actual    283   355   183    48    12    3     0
Poisson   324   324   162    54    13   2.7   .451

This seems to suggest that there is probably a 6-root prime less
than, say, 20000.  As to whether there is a prime p with z(p)=n for
every integer n, that seems less clear.  If the distribution really
is Poisson with expected value 1, then the density of primes with
z(p)=n is 1/(e*n!), which would make primes with, say, 100 roots
extrodinarily rare.  It would be interesting to know how far
the Poisson model accurately predicts the density of z(n).  It
would also be interesting to know if there is an efficient way of
computing z(p) for a given prime p (i.e., more efficient than just
testing all the residue classes one by one).  Also, is there a way
of "constructing" primes with a large number of zeros?

UPDATE:  On 17 June 2000 Don Reble sent an email reporting that he
had found the smallest prime p such that z(p) equals 6.  The prime
is p = 11117, for which the six roots of a(x) are

1500  3380  3897  4156  6694  9949

He checked all primes less than 32768, and this is the only one with
z(p) greater than 5 in this range.  He also identified several more
primes with z(p)=5, so the complete list of all known such primes is
now

151   5209   5653   7639   9343   9871  11329  12373  12979
14731  15461  16267  17159  19457  26591  27281  28309  32467

Over the range of all primes less than 32768, Don found that the
distribution of primes according to their values of z(p) is as shown
below
# of primes  predicted
less than    based on
z(p)   32768       Poisson
----   --------    --------
0       1249       1292
1       1317       1292
2        643        646
3        228        215
4         56         54
5         18         10.76
6          1          1.79
7          0          0.256
8          0          0.032

This certainly seems consistent with the premise that the distribution
is Poisson, i.e., the fraction of primes with z(p)=n is asymptotic to
1/(e*n!).
```