How many sparring partners should I choose for the most effective motivation in the gym? Question is simple.

Will I be more motivated with one good friend or with a group of the same interested people during group exercise?

Does group size affect our internal motivation? (starting by size of 2 people up to X)

Where are bounds for the worst motivation, average motivation and the best motivation for physical workout? (or we can discuss other activities as well) 

My input: I'm just thinking about competition feelings in bigger group of people when my brain is saying something like this: "I have to be better than everyone else." 

This question doesn't need to be exclusively bound to the gym workout.
The Ringelmann effect may be useful to you in this question; he found that "the addition of co-workers in a rope-pulling task leads to a linear decrement in the individual group member's average performance."  It has been examined experimentally here, and was found to occur with the addition of second and third group members, but adding members beyond that didn't have a significant effect.  There was a second experiment that tried to control for the possibility of intermember coordination, but it found the same thing.

(Of course, this leaves out entirely the possibility of differing group dynamics across groups of the same size but with different members. It also does not speak to individual differences--that some people may do better with a larger group, or with varied activity partners, while others do better with smaller groups or more consistent activity partners.)

Alan G Ingham, George Levinger, James Graves, Vaughn Peckham
The Ringelmann effect: Studies of group size and group performance
Journal of Experimental Social Psychology, Volume 10, Issue 4, July 1974, Pages 371–384