36. Many city residents engage in dancing, many in mathematics, and at least one in both. Those who engage only in dancing are exactly $p+1$ times more than those who engage only in mathematics, where $p-$ is some prime number. If you square the number of all mathematicians, you get the number of all dancers. How many residents are interested in both mathematics and dancing at the same time?
36. Answer: 1 person is engaged in both dancing and mathematics.

Let $a$ people be engaged only in mathematics, and $b \geqslant 1$ people be engaged in both dancing and mathematics. Then, according to the condition, $(a+b)^{2}=(p+1) a+b$. Subtract $a+b$ from both sides: $(a+b)^{2}-(a+b)=p a$. Factor out the common term on the left side: $(a+b)(a+b-1)=p a$. Since $p$ is prime, one of the brackets on the left side must be divisible by $p$. Then $a$ must be divisible by the other bracket! But it is clear that the first bracket is greater than $a$, and the second is not less than $a$. Therefore, $a$ can only be divisible by the second bracket, and only in the case where the second bracket equals $a$. This is possible only when $b=1$.