Following is the algorithm for arranging circles in a spiral fashion.
Following clockwise direction.
following is the pseudocode (overall).