Calculating apparent density of stars in sky, given an area and distance away from my viewpoint According to this source, there are $5077$ visible stars in the night sky, and a full sky area of $41253$ square degrees of sky. This makes for a density of $0.12$ stars per square degree of the sky. Suppose I hold up a square picture frame that is $1$ square meter in size ($1\ {\rm m} \times 1\ {\rm m}$), $2$ meters away from me. How many stars can I expect to find contained within that frame? What is the formula if I want to vary the picture frame size (let's say rectangular), or distance away from me (let's say $3$ meters)?
 A: The surface area of a sphere with a radius of $2$ metres is $4 \pi r^2 = 16 \pi \approx 50$ square metres. So a $1$ square metre frame held at a distance of $2$ metres covers about $\frac 1 {50}$ of the whole sphere.
From this you can work out the number of square degrees covered by the $1$ square metre frame, and the maximum number of stars that you can expect to see within it on average (assuming the $5,077$ figure is for the whole sky, and not just the stars visible from one hemisphere). Note that the actual number of stars that you see will depend very much on how good your eyesight is, how clear the sky is, and which direction you are looking in.
A: It is easier to work in solid angle.
If you have 5077 stars covering $4\pi$ steradian of solid angle, then the density of stars is 404 per steradian.
The solid angle subtended by your picture frame of area $A$ would be $A/d^2$ if $d$, the distance to the frame were much larger than the frame dimensions. The more accurate formula is
$$\Omega = 4 \arctan \left( \frac{A}{2d\sqrt{4d^2 + a^2 + b^2}}\right),$$
where $a$ and $b$ are the individual lengths of the sides of the frame. You can see that if $d \gg$ $a$ and $b$ that this reduces to $A/d^2$.
So the average number of stars would be
$$ n \sim 1616 \arctan \left( \frac{A}{ 2d\sqrt{4d^2 + a^2 + b^2}}\right).$$
For your fiducial example, this gives 95 stars.
Note that the stars visible to the naked eye are not however uniformly dispersed across the sky and the density varies by a factor of $\sim 2$ for naked eye stars depending on whether you are looking towards or out of the Galactic plane; e.g.
https://astronomy.stackexchange.com/a/10260/2531
