Pyth, 2424 23 bytes
FkrPE8=Y+Y^@k1@k0;<eSYhEFkrPE8 aY^@k1@k0;<eSYhE
Try it online!Try it online!
Explanation
Fk For loop with the iterator as k
E Take first input.
PE List of prime factors
rPE8 Run length encoding over the list, eg: [2, 2, 3] becomes [[2, 2], [1, 3]]
Y Initialized to an empty list by default.
@k1 Element at index 1 of k.
@k0 Element at index 0 of k.
^ Apply exponentiation.
=Y+YaY Add Append element to Y
SY Sort Y
e Last element
hE Take next input and increment by 1
< Is it less than?