Suppose $G$ is a graph that is triangle free and $\Delta(G)=k$. Let $v\in V(G)$ such that $\operatorname{deg}(v)=k$ and consider $N_G(v).$
CASE I ($p-k\le k$): There cannot be any edges between any two vertices in $N_G(v)$, otherwise $G$ would have a triangle. So $N_G(v)$ is an independent set of vertices whose edges all go to the remaining $p-k$ vertices. Thus $G$ can have at least $k(p-k)$ edges. There cannot be any edges connecting vertices in $V(G)-N_G(v)$ otherwise a triangle would be formed. Thus the maximum number of edges is $k(p-k)$.
CASE II ($p-k>k$): There cannot be any edges between any two vertices in $N_G(v)$, otherwise $G$ would have a triangle. So $N_G(v)$ is an independent set of vertices whose edges are distributed amongst the remaining $p-k$ vertices. Thus $G$ can have at least $k^2$ edges. Now for each $u\in N_G(v)$ there are at least $p-2k>0$ vertices in $V(G)-N_G(v)$ that are not in $N_G(u)$ and we can add these edges into $V(G)-N_G(v)$ without creating triangles. So we can add at least $k(p-2k)$ more edges to $G$ so that we have at least $k^2+k(p-2k)=k(p-k)$ edges in $G$. If we try to add any more edges to $G$ we will either form a triangle by connecting two vertices in $N_G(u)$ for some $u\in N_G(v)$ or by connecting two vertices not in any $N_G(u)$. Thus the maximum number of edges is $k(p-k)$.
In either case, we are done.