I don't think it's just a simple division.
Let me derive the C(n,k) formula from the P(n,k) just to show how to generally use an overcounting factor:
say we have n distinct elements, and we want to know how many different combinations of k objects we can choose. There are P(n,k) permutations.
now for clarity, suppose we have n=5, and k=3. and our objects a,b,c,d,e:
Here is a list of permuations in a rectangle:
abc,acb,bac,bca,cab,cba
abe,aeb,bae,bea,eab,eba
.
.
.
etc.
that is, imagine that we list all the permutations, such that all permutations that are the same combination, are in the same row. Obviously there are C(n,k) rows, and a total of P(n,k) elements. But how many in each row? well the answer is k! since there are k! ways of arranging a fixed combination of k elements. Therefore P(n,k)=C(n,k) * k!
====================================================================================
Back to TT's modification of the RAMANUJAN problem:
Recall that our proof above used a bijection between rows and combinations, we will try to do something similair here. suppose that the A's are A1,A2,A3 and the N's N1 and N2. So basically we want to count (N2)R(N1) and (N1)R(N2) as the same thing. Again, arrange the words in a rectangle:
(N1)R(N2),(N2)R(N1)
(N1)J(N2),(N2)J(N1)
(N1)M(N2),(N2)M(N1)
.
.
.
etc.
Now it is looking good so far, we have that 2! factor represented in the length of each row, however this pattern does not continue, as eventually once we start listing words such as AMA, our row length will be bigger!:
(A1)M(A2),(A2)M(A1),(A1)M(A3),(A3)M(A1),(A2)M(A3),(A3)M(A2)
Therefore, I think in order to solve this problem, you must break it up into different cases, since in some cases we get a bigger length in each row.