Basically, I have a probability that a specific coloured ball is being chosen being (1/n(n+1)).

I am completely foreign to R and have no idea how to run a loop using the formula that I found to simulate the number of turns it would take to pick the specific coloured ball.

It would be great if someone could help me with writing the code or at least point me in the right direction!