wrote prototype of legendre_pi

The code for legendre_pi works, but it cannot compute n for very large
values because it will exceed the maximum recursion depth.  (Memoization has
not yet been implemented.)
Added memoization

The function still exceeds the max. recursion depth for pretty small values
of n, though.
Minimized the amount of recursion in legendre_pi

I elimintated most of the rucrsion calls in legendre_pi, which now allows
the code to run on substantially larger n.

Nevertheless, the function still exceeds the max. recursion depth for
relatively small n (~10^6).  Recursion should probably be eliminated
entirely.
Optimized the algorithm to minimize recursion

The algorithm for legendre_phi now automatically returns 0 if x = 0.  This
drastically speeds up the computation and minimizes the number of recursive
calls.  Now it is possible to call legendre_pi with integers as large as
10^6.