Lucas' Theorem For Prime Powers: (Modp'+t)
Lucas' Theorem For Prime Powers: (Modp'+t)
Lucas' theorem on binomial coefficients states that(~)== (i:~) · · · (i:P(i:~)(modp) where pis a
prime and A= a,p' + · · · + a1 p + a 0 , B = b,p' + · · · + b 1 p + b 0 are the p-adic expansions of
A and B. If s ;;. 2, it is shown that a similar formula holds modulo p' where the product
involves a slightly modified binomial coefficient evaluated on blocks of s digits.
INTRODUCTION
One of the most beautiful results concerning binomial coefficients is Lucas' Theorem
[1, 2]. If 0.;;; B.;;; A are integers and p is a prime, write A and B in p-adic notation
A= a,p' + · · · + a 1p + a 0 , B = b,p' + · · · + b 1p + b 0 , where 0.;;; a;, b; < p and a, =I= 0.
Then
( A)=
B
(a')(ar-1) ... (at)(ao)(modp).
b, b,_ 1
(1)
b 1 b0
If A- B = c,p' + · · · + c 1p + c0 and p' I (~) then Kazandzidis [3) proved that
( A)= (-p')
B
~(modp'+t).
i=Ob;! C;!
IT
This result is applicable for only one power of p for each (~), and in particular does
not apply for t ;;::.1 if((~), p) = 1. Singmaster [5) also obtained similar results.
For integers A and B as above, define the string A;i = a;a;_ 1 · · · ai for 0.;;; j.;;; i.;;; r,
with B;i defined similarly. Corresponding to a string A;i is the integer d;i = a;pi-i +
· · · + ai+tP + ai. Let .;;; be the lexical order on strings, so that A;i.;;; B;i iff d;i.;;; :ll;i,
with 0; denoting the string of i + 1 zeros.
We also define a modified binomial coefficient on such strings as follows. In the
following assume j is fixed and write A; = A;i, etc. Also ps is a fixed power of p.
If B; .;;;A; then (~·) = (~').
p;
If A 0 < B 0 then (~~) = and recursively if A;< B;, i ;;::.1, then (~;) = p(~;::: ).
In general (~;) = p'a, where t;;;;. 0 and pI a.
Formally, (~;) -l = p-'a-I, where a- 1 is such that aa- 1 = 1(modps) and 0 < a- 1 <
ps. The following properties are clear:
(1) (~•)(~·)- 1 = 1(modp8 ) .
(2) If Ak ~ Bk and Ak+r < Bk+t for 1.;;; /.;;; i - k then (~;) = pi-k<~z).
(3) Suppose p' II (~;). If A;;;;;. B; then it is well known that tis the number of borrows
necessary in the subtraction d;- £YJ;. [4) If A;< B; then tis the number of borrows in
the subtraction (pi+ 1 + d;) - £YJ;. Thus if ( ~;::) ( ~;) -t = p' a, where p I a, then t;;;;. 0.
Our goal is to prove the following generalization of Lucas' Theorem which
completely determines the value of any binomial coefficient modulo any prime power.
THEOREM 1. For any integers 0.;;; B .;;; A and any prime power ps, 2 .;;; s .;;; r + 1,
(
A) =I as-1 ... ao)
1
'11
I aj+s-1 ... ai)l aj+s-2 . .. aj)-l
B \bs-1 · · · bo \bj+s-1 · · · bj \bj+s-2 • ' · bj
j=l
(2)
= 1As-t) '[i 1 1
1Ai+s-t,j)l Ai+s-2,j)- (mod ps).
\Bs-1 j=l \Bj+s-l,j \ Bj+s-2
229
0195-6698/90/030229 + 05 $02.00/0 © 1990 Academic Press Limited
230 K. S. Davis and W. Webb
The modified binomial coefficients are needed only in evaluating (~i), where Bj > Aj,
so we have as an immediate corollary. '
The following example illustrates how this theorem can be used in a specific case.
Note that we can always reduce the calculation to ordinary binomial coefficients.
Let p = 7 and s = 3, and suppose that the base 7 representations of A and B are
A= 2413605 and B = 1261632.
1 1 1
2413605) = J241)J41)- J413)J13)- Jl36)(36)- J360)J60)-l/605)
( 1201632 \120 \20 \201 \01 \016 16 \163 \63 \632
1 1 1
= (241)(41)- (413)(13)- (136)(36)- (360)r 272 (5)
120 20 201 1 16 16 163 2
= (33)(286) - (116)(10)- (10)(3) - (98)(10)
1 1 1
PROOF OF THEOREM 1
The following lemma will be useful.
LEMMA:
(
pA) = (A) Yf fi p(k +A - ~)- j
pB B j=t k=1 pk - J
for integer 0 :s::; B :s::; A.
PROOF:
Our proof of Theorem 1 uses induction on A. It is trivial for A < p. From now on let
A; =A;o etc. Let ll (An Br) = ll (A, B) denote a product of the type on the right side
of (2), and
(3)
by the lemma.
Since 0 ~ {3, ~a,< A, we may apply the induction hypothesis to (~;). We also note
that formally, the expressions for IT (A, B) and IT (a" {3,) are identical except for two
factors. Hence,
(4)
1
= ((X')(As-1)(As-1,1)- .
{3, Bs-1 Bs-1,1
If psI($~) then both sides of (2) are zero and case 1 is settled. Otherwise, let pJ...II ($~)
where A< s. Then comparing (3) and (4), equation (2) holds iff
Yi TI
j=1 k=1 pk- 1 Bs-1 Bs-1,1
1
p(k +a,-~,)- j = (As-1)(As-1,1)- (modps-J...). (5)
By earlier remarks,
1=f TI
j=1 k=fJu+1
p(k +a,-~,)- j = l(modps-J...).
pk- 1
(7)
232 K. S. Davis and W. Webb
We observe that px- j runs over a reduced residue system modulo pu+ 1 as
1 ~ j ~ p - 1 and x runs over any pu consecutive integers. In (7), k runs over
fJr- fJu = brpr + · · · + bu+ 1Pu consecutive integers. This in (7), both p(k + ar- fJr)- j
and pk- j runs over a reduced residue system modulo pu+\ exactly brpr-u + · · · +
bu+ 1 times, which proves (7).
(A) ( A ) B +1
B = B+1 A-B·
By Case 2, equation (3) holds for (B'!- 1) and so it suffices to show that
p• In· IAs-1)-
\Bs-1
n· I As-1 ) ~'
\Bs-1 + 1 A - B
where TI* = TI*(A, B)= TI* (A, B + 1). Since A= .si._1and B= oo._1(modp•) we
must show that
Now,
I A•-1) = P,l Au),
\Bs-1 \Bu
where Au > Bu for some u =s - t - 1 > 0, and also
I As-1 ) ,1 Au )
\Bs-1 + 1 = p \Bu + 1 '
where Au ~ Bu + 1. By earlier remarks TI* is divisible by a non-negative power of p
and so it suffices to show that
(8)
Case 4: a 0 = 0 and b0 =F 0. This is similar to Case 3. By Case 1, the theorem holds for
(~), where b0 = 0 and a 0 = 0. For A fixed, a 0 = 0, assume true for (~), where
0 ~ b 0 ~p- 2, and note that
A ) (A)
A -B
( B+1 = B B+1
Lucas' theorem for prime powers 233
(9)
/ As-1 ) jAs-1)
\Bs-1 + 1 = p• = \Bs-1 '
in which case (9) is immediate. Otherwise,
As-1 ) 1( Au )
( Bs-1 + 1 = p Bu + 1 '
REFERENCES
1. L. E. Dickson, History of the theory of numbers, Vol. 1, Chelsea, New York, 1952.
2. N.J. Fine, Binomial coefficients modulo a prime, Am. Math. Monthly, 54 (1947), 589-592.
3. G. S. Kazandzidis, Congruences on binomial coefficients, Bull. Soc. Math. Grece (NS), 9 (1968), 1-12.
4. D. Singmaster, Divisibility of binomial and multinomial coefficients by primes and prime powers, From a
collection of manuscripts related to the Fibonacci Sequence.
5. D. Singmaster, Notes on binomial coefficients 1-a generalization of Lucas' congruence, J. Lond. Math.
Soc. (2), 8 (1974), 545-548.
Received 16 May 1989 and accepted 15 January 1990
KENNETH S. DAVIS
Albion College,
Department of Mathematics,
Albion, Michigan 49224, U.S.A.
WILLIAM A. WEBB
Washington State University,
Department of Pure and Applied Mathematics,
Pullman, Washington 99164-2930, U.S.A.