Cannonball Conundrum Your task is to, with an input number p, find the smallest positive cannonball number of order p that is NOT 1.

Definition

A cannonball number (of order p) is a number which is both:


An p-gonal number (See this page).
and an p-gonal pyramid number.


The nth p-gonal pyramid number is the sum of the 1st to nth p-gonal numbers.


(e.g. 4th square pyramid number = 1 + 4 + 9 + 16 = 30)

The picture below represents the 4th square pyramid number, as a square pyramid.

For more info, visit this link.



The cannonball number of order 3, for example, is 10, because it is:


The fourth triangle number (1 + 2 + 3 + 4 = 10)
and the third triangular pyramid number. (1 + 3 + 6 = 10)


Formulas

NOTE: If you can find (or make) more useful formulae than my ones here, please post it here (or message me on the question chat thing).


If you're interested, the formula for the nth p-gonal number is:





And the nth p-gonal pyramid number is:




Specs


p is guaranteed to be larger than 2.
The program must check values for a solution for p up to (and including) 2^16. Your program may do anything if no solutions are found for p.
Only positive indices for n.


Test cases


3 outputs 10 (4th triangle number, 3rd triangle pyramid number)
4 outputs 4900 (70th square number, 24th square pyramid number)


This is code-golf, so shortest answer in bytes wins.

Note: If you do post a solution, please include a description of how the code works.

Should I start a bounty for a solution which is better and doesn't use my formulae?
Python 3, 129 127 bytes
def f(p):
 x=2
 while 1:
  for i in range(x*x):
   if i//x*((p-2)*i//x+4-p)/2==i%x*(i%x+1)*((p-2)*i%x+5-p)/6==x:return x
  x+=1

A function that takes input via argument and returns the output.
This is an extremely naïve brute force, and takes a very long time for even moderately large p; the execution time will be ridiculous for anything approaching the given maximum for p of 2^16, but there is no reason why the program would not work, given sufficient time.
There are probably far shorter and faster ways of doing this, but I thought it would be good to post something to get this started off.
How it works
The return value x is initialised to 2, and then the program simply loops over all the p-gonal and p-gonal pyramidal numbers up to order x. If the current p-gonal and p-gonal pyramidal numbers, calculated using the formulas, are equal to each other and to x, then x must be the relevant cannonball number and this is returned. Else, x is incremented, and the program tries again for the new value of x.
In terms of golfing, a Cartesian product is used to collapse the two for-loops for the p-gonal and p-gonal pyramidal numbers into a single loop, and the formulas were factorised further to save a few bytes.