# Implementing the factorial rule

I want to implement a command in Mathematica in order to simplify factorials in the following way

$$(n+x)!=(n+x)(n+x-1)\cdots n!$$

I started to build this up slowly. I have managed to implement

$$(n+x)!=(n+x)(n+x-1)!$$

in the following way

factorialproperty[function_] := # (# - 1)! &@function
(p + 3) // factorialproperty


And then I thought, to use this in a NestWhile to iterate the procedure, however, I have not managed to make it work. What I tried to do is the following

fctrl[function_] :=
Module[{a = function},
NestWhile[a, Product[(# - i)! &@a, {i, 0, 100}], a >= 0]]


And when I tried

(p + 3) // factorialproperty


I got the wrong result. I thought that I am telling Mma to do the product starting with a, a number of times (I chose i to be 100 because I will never have to compute something higher than that), until applying the product gives negative values, but clearly I have some mistake.

Any help would be appreciated.

Thanks.

Is this what you want?

transform = (a_ + x_Integer/;x>=1)! -> Pochhammer[a+1,x]*a!;
(p + 3)! /. transform


(1 + p) (2 + p) (3 + p) p!

This also works on more general expressions:

(p + q + 3)! /. transform


(1 + p + q) (2 + p + q) (3 + p + q) (p + q)!

(Sqrt[2] + 3)! /. transform


(1 + Sqrt[2]) (2 + Sqrt[2]) (3 + Sqrt[2]) Sqrt[2]!

expandFactorial[expr_] := ReplaceRepeated[expr, (x_Symbol + i_Integer)! :> (x + i) (x + i - 1)!];