Algorithm to convert decimal number to binary
Just converting the comment into a short answer:

$7 = \text{int}(\log_{2} 236)$. Generally, $p = \text{int}(\log_{B}V)$.



As other people pointed out, this algorithm is needlessly complicated and not practical; it is not easy to calculate $\log_B V$ for large $V$ by pencil and paper. Instead, use the other algorithm which is also mentioned in the article you are reading:

From decimal to binary


Step 1: Check if your number is odd or even.
Step 2: If it's even, write 0 (proceeding backwards, adding binary digits to the left of the result).
Step 3: Otherwise, if it's odd, write 1 (in the same way).
Step 4: Divide your number by 2 (dropping any fraction) and go back to step 1. Repeat until your original number is 0.