Question 992986
Literally transcribe the description.  No tricks are needed!


p, "a number";  You can choose any variable you want.
"Three times the sum..."
{{{3(theSumWhichWillBeDescribed)}}}


"the sum of a number and 4 minus the number"
{{{(p+(4-p))}}}


"...is 18."
{{{3(p+(4-p))=18}}}


The real trouble is that your description is bad.  You cannot solve the equation and the equation is FALSE.