A wave function constructed from prime counting function is employed to study the properties of primes using quantum dynamics. The prime gaps are calculated from the expectation values of position of prime numbers. In an analogous nonlinear system, the trajectories, associated nodes with their stability condition and the bifurcation dynamics are studied using classical dynamics. It is interesting to note that the Lambert W functions appear in connection to solutions for the fixed points as functions of energy. The derived potential with the divergence also resembles the effective potential a test particle feels near a massive spherical object in General Theory of Relativity. The coordinate time and proper time corresponding to a black hole serendipitously find their analogy in the solution of the nonlinear dynamics representing primes. The stereographic projection obtained from quantum dynamics on unit circle in the (θ, p θ ) phase space of the real numbers present along x-axis in general and prime numbers in particular provides a simple way to calculate a formula for upper bounds on the prime gaps. The estimated prime gaps is found to be significantly better than that of Cramer’s produced values.