(In reply to
Analytical solution by Federico Kereki)
you say:
Multiplying both results, 4=(16-q^6)/q^2, so q^6-4q^2-16=0. Writing q^2=r we get r^3-4r-16=0 which has a single real root r=2, so if q=2 then p=1+2, and if q=-2, then p=1-2.
correction:
Multiplying both results, 4=(16-q^6)/q^2, so q^6-4q^2-16=0. Writing q^2=r we get r^3+4r-16=0 which has a single real root r=2, so if q=2 then p=1+2, and if q=-2, then p=1-2.