An exercise concerning Sum(`/`(1, `*`(i)), i = 1 .. `+`(p, `-`(1))), and the half and quarter sums Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 2), `*`({`+`(p, `-`(1))})))) and Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 4), `*`({`+`(p, `-`(1))}))))  

 

 

First, an exercise for you: prove, for an odd prime p, that the numerator (of the fraction) in the sum: 

 

Sum(`/`(1, `*`(i)), i = 1 .. `+`(p, `-`(1))) = `+`(`+`(`+`(`*`(1, 1), `/`(1, 2)), `/`(1, 3)), `...`, `/`(1, `*`(`+`(p, `-`(1))))) 

 

is (i.e., is divisible by p). 

_________________ 

 

But now, two less obvious sums, the first due to Eisenstein (early 1800s), the second to Lerch-Glaisher (~ 1900): 

 

 

 

 

`and`(Sum[half](p) = Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 2), `*`({`+`(p, `-`(1))})))), Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 2), `*`({`+`(p, `-`(1))})))) = `+`(`+`(`+`(`*`(1, 1), `/`(1, ... 

 

satisfies . 

 

 

> L := []: for p from 3 to 50 do if isprime(p) then

            q||p := (2^(p-1) - 1)/p: ### the Fermat quotient base 2

            S||p := add(1/i, i = 1..(p-1)/2): ### the half sum

                L := [op(L), p]: fi od:

     print(``);

p := 'p': print(``);

print(array([['p', ``, ``, 'S[half]', ``, q['p'](2), ``, S[half], ``, -2*q[p](2)],

seq([p, ``, ``, S||p, ``, q||p, ``, S||p mod p, ``, -2*q||p mod p], p = L)])): print(``);

lprint(`The last two columns are mod p reductions.`);
 

 

 

 

 

array( 1 .. 15, 1 .. 10, [( 1, 4 ) = (S[half]), ( 3, 2 ) = (``), ( 14, 4 ) = (`/`(18858053, 5173168)), ( 11, 10 ) = (19), ( 15, 6 ) = (1497207322929), ( 1, 5 ) = (``), ( 5, 7 ) = (``), ( 5, 1 ) = (11)...
`The last two columns are mod p reductions.`
 

>
 

 

 

 

 

 

`and`(Sum[quarter](p) = Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 4), `*`({`+`(p, `-`(1))})))), Sum(`/`(1, `*`(i)), i = 1 .. `+`(`*`(`/`(1, 4), `*`({`+`(p, `-`(1))})))) = `+`(`+`(`+`(`*`(1, 1), `/`(... 

 

satisfies . 

 

 

> L := []: for p from 5 by 4 to 100 do if isprime(p) then

            q||p := (2^(p-1) - 1)/p: ### the Fermat quotient base 2

            S||p := add(1/i, i = 1..(p-1)/4): ### the QUARTER sum

                L := [op(L), p]: fi od:

     print(``);

p := 'p': print(``);

print(array([['p', ``, ``, 'S[quarter]', ``, q['p'](2), ``, S[quarter], ``, -3*q[p](2)],

seq([p, ``, ``, S||p, ``, q||p, ``, S||p mod p, ``, -3*q||p mod p], p = L)])): print(``);

lprint(`The last two columns are mod p reductions.`);
 

 

 

 

 

array( 1 .. 12, 1 .. 10, [( 9, 9 ) = (``), ( 12, 7 ) = (``), ( 5, 3 ) = (``), ( 7, 2 ) = (``), ( 3, 4 ) = (`/`(11, 6)), ( 9, 4 ) = (`/`(1195757, 360360)), ( 11, 3 ) = (``), ( 6, 7 ) = (``), ( 2, 9 ) =...
`The last two columns are mod p reductions.`
 

>
 

 

Remark. This congruence holds for primes ; all that is required is floor(`+`(`*`(`/`(1, 4), `*`({`+`(p, `-`(1))})))) instead of `+`(`*`(`/`(1, 4), `*`({`+`(p, `-`(1))}))).