A technical interlude: base factorial representation

An elementary exercise that one sometimes sees in sequences/series problems in texts is: prove that

n . n ! + ( n -1).( n -1)! + ... 3.3! + 2.2! +1.1! = ( n +1)! - 1 ... (1)

Someone whose bag of tricks consists only of the school ' turn it back to front ' (for adding arithmetic series) or

' multiply by r ' (for adding geometric series) is going to get stuck on this...

Here the obvious solution is dictated by thinking about a particular case of (1), and then seeing ... . Suppose, say, that n is 3, then the LHS of (1) is (3.3! + 2.2! + 1.1!), namely (18+4+1), which is 23. And the RHS of (i) is (4! - 1), which is also 23. Now (with n = 4 ) if one adds 4.4! to '23' - which is both (3.3! + 2.2! + 1.1!) and (4! - 1) - one obtains

4.4! + (3.3! + 2.2! + 1.1!) = 4.4! + (4! - 1) = (4+1).4! - 1 = 5.4! - 1 = 5! - 1

The simple point is that k . k ! + k ! = ( k +1). k ! = ( k + 1)!, and thus a proof of (1) may be given 'by induction'.

Alternatively just see what happens when one adds '1 (=1!)' to the LHS of (1):

n . n ! + ( n -1).( n -1)! + ... 3.3! + 2.2! + (1.1! + 1!)

= n . n ! + ( n -1).( n -1)! + ... 3.3! + 2.2! + 2!

= n . n ! + ( n -1).( n -1)! + ... 3.3! + 3!

= n . n ! + ( n -1).( n -1)! + ... 4!

= ... = n . n ! + ( n )! = ( n +1). n ! = ( n +1)!

and subtracting '1' gives

n . n ! + ( n -1).( n -1)! + ... 3.3! + 2.2! +1.1! = ( n + 1)! - 1

Remark . (1) should simply be seen as being the ' base factorial ' equivalent of what happens in the base 10 system (or indeed any polynomial base system) with examples like 999 + 1 = 1000 (i.e. 999 = 1000 - 1), or 9999 + 1 = 10000 (i.e. 9999 = 10000 - 1) (in binary base: 1111 + 1 = 10000 (i.e. 1111 = 10000 - 1)), because every non-negative integer n may be represented ( uniquely ) by

n = d[r]*r!+d[r-1]*(r-1)! + ... + d[3]*3!+d[2]*2!+d[1]*1! (= ( d[r] , d[r-1] , ... , d[3] , d[2] , d[1] ))

where the digits d[r] , d[r-1] , ... , d[3], d[2], d[1] satisfy 0 <= d[j] and d[j] <= j .

MK, in his article, writes the digits the other way round, but I believe the above is more natural, and is the convention followed by D. E. Knuth in his classic Seminumerical Algorithms, Vol. 2, The Art of Computer Programming .

Examples . The integers 0, 1, 2, ... , 23 (= 4!-1) have the following base factorial representations:

0 = (0, 0, 0), 1 = (0, 0, 1), 2 = (0, 1, 0), 3 = (0, 1, 1), 4 = (0, 2, 0), ... , 22 = (3, 2, 0), 23 = (3, 2, 1)

Of course (e.g.) '3' is just (1, 1), but I have written it as (0, 1, 1) because I wanted to have it appear as a triple, with '23' - the extreme triple - in mind. Maple doesn't appear to have a command for converting an integer to base factorial (trying Maple's '?factorial' and '?base' produced no related topic), so I have written a simple Maple procedure for finding such representations, which I will call 'facKn' (Kn, for Knuth, with the dominant digits left to right, as in the normal decimal or general polynomial base):

> facKn := proc(n) local j, r, d, N, k;
if n=0 then print(0=[0][fKn])
else for j while j! <= n do od: r := j-1:
d[r] := iquo(n, r!);
N[r] := n - d[r]*r!;
for k from r-1 by -1 to 1 do
d[k] := iquo(N[k+1], k!);
N[k] := N[k+1] - d[k]*k!;
od;
print(n=[seq(d[r+1-k], k=1..r)][fKn]);
fi; end:

> facKn(0);

0 = [0][fKn]

> facKn(1);

1 = [1][fKn]

> facKn(2);

2 = [1, 0][fKn]

> facKn(3);

3 = [1, 1][fKn]

> facKn(4);

4 = [2, 0][fKn]

> facKn(20!-1);

2432902008176639999 = [19, 18, 17, 16, 15, 14, 13, ...

> facKn(123454321);

123454321 = [3, 1, 0, 1, 6, 6, 2, 0, 0, 0, 1][fKn]

>

A helping hand (not aimed at my students!!). If you are not familiar with programming then the above may not make much sense, but if you are then the thinking behind it is obvious; it is simply based upon extending a simple example like: convert 63 (say) to base factorial.

Roughwork . 4! = 24, 5! = 120, and so 63 lies between 4! and 5!. Thus 63 = d[4]*4!+d[3]*3!+d[2]*2!+d[1]*1! .

d[4] is the quotient when 63 is divided by 4!

and so is ' 2 '. Then setting N[4] = 63-d[4]*4! = 63-2.24 = 15

Then d[3] is obtained by finding the quotient when N[4] (= d[3]*3!+d[2]*2!+d[1]*1! ) - namely 15 - is divided by 3! (so the quotient is 2 , since 15 = 2 .3! + 3, and one then forms N[3] by subtracting d[3]*3! from N[4] , etc. One will eventually obtain: 63 = 2 .4! + 2 .3! + 1 .2! + 1 .1!.

There are some other elements (while, r:=j-1, etc) that would need explanation for a pure beginner, and I would recommend such a person to consult some of my 1st year Maple material. Here are the continued details for the example n = 63, but not written as a procedure (the above facKn is a procedure)

> n := 63: for j while j! <= n do od: r := j-1:
d[r] := iquo(n, r!): N[r] := n - d[r]*r!:
for k from r-1 by -1 to 1 do
d[k] := iquo(N[k+1], k!): N[k] := N[k+1] - d[k]*k!: od:
print(63=[seq(d[r+1-k], k=1..r)][basefactorial]);

63 = [2, 2, 1, 1][basefactorial]

>

Now to return to the