Maple implementation of Hadamard's gamma
and Luschny's factorial function
# ========== Basic Definitions =========
s := proc(x)
if x = 0 then RETURN(1) fi;
sin(Pi*x)/(Pi*x) end:
g := proc(x)
if type(x, negint) then RETURN(undefined) fi;
if x = 0 then RETURN(1/2) fi;
(x/2)*(Psi(x/2+1/2)-Psi(x/2)) - (1/2) end:
P := proc(x)
if type(x, negint) then RETURN(0) fi;
1 - s(x)*g(x) end:
L := proc(x)
if type(x, negative) then RETURN(g(-x)/(-x)!) fi;
x!*P(x) end:
# Computes L(x)*L(-x)
Lambda := proc(x)
if type(x, negint) then RETURN(limit(g(w)*P(w),w=x)) fi;
g(x)*P(x) end:
# Computes 1/(L(x)*L(-x)*x!*(-x)!)
invLL := proc(x)
if type(x, integer) then if x <> 0
then RETURN(0) else RETURN(4) fi fi;
t := g(x); 1/(t*(1/s(x)-t)) end;
# ===== Auxiliary Functions and some Identities ======
# Convention: FunctionNumber(x) = Function(x)
# ====================================================
Lambda1 := proc(x)
if type(x, negint) then RETURN(limit(g(w)*P(w),w=x)) fi;
t := g(x); t*(1-s(x)*t) end:
# h(x) = g(-x)
h := proc(x)
if type(x, posint) then RETURN(undefined) fi;
if x = 0 then RETURN(1) fi;
(x/2)*(Psi(x/2+1)-Psi(x/2+1/2)+Pi*cot(Pi*(x/2+1))
-Pi*(cot(Pi*(x/2+1/2))))-(1/2) end:
# Computes the rational values r(n) for n = 0,1,2,3,..
r := proc(z) cos(z*Pi)*g(z)+z*ln(2) end:
# Computes L(-n) for integers n>0
Lnegint := proc(n) g(n)/n! end:
# Computes the generalized alternating harmonic numbers
A := proc(z) 1/2*cos(Pi*z)*(Psi(z/2+1/2)-Psi(z/2+1))+ln(2) end;
# ===== Functions P*(z) and L*(z) ======
# auxiliary function for P*(z)
t := proc(z) w := exp(2*z); (w-1)/(w+1) end;
# Computes P*(z)
PS := proc(z) if z = 0 then RETURN(1/2) fi;
(1+1/z*sqrt(z*(z-s(z)*t(z))))/2 end;
# Computes L*(z)
LS := proc(x)
if type(x, negint) then RETURN(limit(GAMMA(w+1)*PS(w),w=x)) fi;
GAMMA(x+1)*PS(x) end: