# Prime factorization of numerator and denominator of rationals

I am completely new to Mathematica and I need some help (sorry if it is trivial, but I haven't found the answer). I have this code

K[Q_, n_Integer] :=
Module[{z, x},
SymmetricReduction[
SeriesCoefficient[
Product[
ComposeSeries[Series[Q[z], {z, 0, n}], Series[x[i] z, {z, 0, n}]],
{i, 1, n}],
n],
Table[x[i], {i, 1, n}],
Table[Subscript[c, i], {i, 1, n}]][[1]]]


Then I evaluate

K[Sqrt[#]/Tanh[Sqrt[#]]&, 8] /. c -> p


The output is a polynomial in p1, p2 ... p8 (in this case) with coefficients written as fractions (23412/7538293, for example). What should I do in order to output the numerator and denominator of each function in it's prime factorization (preferably factor out the common divisor of the denominator)?

• Together will pull out the lcm of the denominators. I'm not sure if that's quite what you want though. – Daniel Lichtblau Mar 3 '18 at 15:50
• @DanielLichtblau Thank you for this. Is there a way to write the denominator and numerator of each fraction (after the pulling out of lcm) as product of prime numbers (prime factorization)? – Silviu Mar 3 '18 at 18:25
• The method by @BIll looks viable for this. – Daniel Lichtblau Mar 3 '18 at 19:52