Question 1025446
There is not a closed form solution. 
The solution depends on d and D.
Check https://en.wikipedia.org/wiki/Circle_packing_in_a_circle for some guidance.