Polygonal numbers are of the form $\cfrac {n^2(s-2)-n(s-4)}{2}$, where $s$ is the number of sides e.g. when $s=5$ we get pentagonal numbers, and $n$ is which one in   order it is i.e. the $n^{th}$  $s$-gonal number.  
  
Mersenne numbers are of the form $2^p-1$. We usually speak of Mersenne primes, but in my case I am looking at all Mersenne numbers. 
   
So to find numbers that are both polygonal and Mersenne, we get
$$\cfrac {n^2(s-2)-n(s-4)}{2}=2^p-1$$
where $n,p,s \in \mathbb Z^+$. At $n=1$, we simply get $1$, that is to say the first $s$-gonal number is $1$, and at $n=2$ we get $s=2^p-1$, that is to say the second $s$-gonal number is $s$, so to avoid trivial solutions we say $n \ge 3$. Also $s \ge 3$, since we are talking about **poly**gons.    

To start of I transform the equation into 
$$\frac{2(2^{p} + n^{2} - 1 - 2n)}{n(n-1)} = s$$
Then through a bit of modular artihmetic we can get three cases of $n$ [1]
$$n \equiv 2 \pmod 4$$
$$n \equiv 3 \pmod 4$$
$$n \equiv 5 \pmod 8$$

It is also possible to transform the equation into a Mordell type equation ($x^2=y^3+k$) [2]   


If $3+p=3a$
$$((s-2)(2(s-2)n-s+4))^2+(s-2)^2(-s^2+16s-32)=((s-2)\cdot2^a)^3$$
If $3+p=3b+1$
$$(2(s-2)(2(s-2)n-s+4))^2+4(s-2)^2(-s^2+16s-32)=((s-2)\cdot2^{b+1})^3$$
If $3+p=3c+2$
$$(4(s-2)(2(s-2)n-s+4))^2+16(s-2)^2(-s^2+16s-32)=((s-2)\cdot2^{c+2})^3$$
So this way we can find all possible solutions $n,p$ for a given $s$, but calculating solutions to Mordells equation for a large $k$ is quite the task, so this is not what we are ultimately looking for.  
  
One can also prove that the equation has a finite amount of solutions $n,p$ for each $s$ through transforming it into $$x^2+D=AB^y$$ where $D,A,B$ are given and $x,y$ are the variables 
$$(2(s-2)n-s+4)^2+(-s^2+16s-32)=(s-2)\cdot2^{p+3}$$
and since it has been proven that for every case of $x^2+D=AB^y$ there are finite solutions $x,y$, there are finite solutions $n,p$ for a given $s$
  
It is also quite easy to prove that $2^p-1$ cannot be prime
    
If $n=2a$
$$a(2as-4a-s-4)=2^p-1$$
$a=1,n=2$ but we do not count $n=2$, as stated earlier  
  
If $n=2b+1$
$$(bs-2b+1)(2b+1)=2^p-1$$
either $b=0,n=1$ or $s=2$, but we do not count those, because of the reasons stated earlier.
  
My main goal is to find a way to easily calculate all solutions $n,p$ for any given $s$. An idea that I have is to find $n_{max},p_{max}$ in terms of $s$, so that when I give an $s$, I can easily just make the range of $n,p$ $$n_{max} \geq n \geq 3, p_{max} \geq p \geq 0$$ but this assumes that $n_{max},p_{max}$ will be small.

So my question is: Does anyone have any ideas on how to find $n_{max},p_{max}$, and do they even exist. Any other ideas on how to solve this problem (finding every possible $n,p$ for a given $s$). 

  
Any insight, tips, or just generally help would be greatly appreciated. Also please ask if you require further details.  
(Is it still too vague what I am asking for?)

    [1] Greg Martin
    [2] user236182

-redelectrons