Some intuition,

Say we have total friends,n = 10

So, at most one people can have n-1 friends = 9 = r

But we are supposed to pick $\bf{at most}$ 1 friend, that means, I can pick 0(no friend) or a 1 friend.

So, two cases,

i. Minimum case:

If I pick 1 friend friend of each out of n = 10 people

then $\frac{n}{r^2+1}$ = 10/(1^2+1) = 5.

ii. Maximum Case:

If 0 friend picked.

then $\frac{n}{r^2+1}$ = 10/(0^2 + 1) = 10.

This calculation can be generalized with the help of a graph.

Say we have total friends,n = 10

So, at most one people can have n-1 friends = 9 = r

But we are supposed to pick $\bf{at most}$ 1 friend, that means, I can pick 0(no friend) or a 1 friend.

So, two cases,

i. Minimum case:

If I pick 1 friend friend of each out of n = 10 people

then $\frac{n}{r^2+1}$ = 10/(1^2+1) = 5.

ii. Maximum Case:

If 0 friend picked.

then $\frac{n}{r^2+1}$ = 10/(0^2 + 1) = 10.

This calculation can be generalized with the help of a graph.