Solution (source code)

= Solution

Conditional on $N=n$, there are $\binom n2$ pairs, and each is both friendly and birthday-matched with probability $1/(2\cdot365)$. Since $\mathbb E[N(N-1)]=365^2$ for a Poisson variable,
$$
\boxed{\mathbb E[\text{matching friend pairs}]
=\frac{365^2}{2}\frac1{730}=\frac{365}{4}.}
$$