Assuming ! means factorial and ^ means "to the power of",
given your formula n!^2 and n = 4 you get:
(2*3*4)*(2*3*4)
If a factor is not prime, you will have to compute its prime factors, like...