1 # Philippe's simple example
2 #--------------------------
7 #--------------------------
17 #--------------------------
21 Philippe's simple example
23 #--------------------------
24 # I have done the work by hand, and here is the right
27 # If 1 <= M <= N then EP(N,M) = 1/2 M^2 + 1/2 M
28 # If N <= M <= 2N-1 then EP(N,M) = -3/2 N^2 - M^2 + 3NM - M
29 # If 2N-1 <= M <= 3N-2 then EP(N,M) = 9/2 N^2 + 1/2 M^2 - 3NM - 3/2 N + 1/2 M