I'm trying to plot $$p(n)=1-\sum_{i=0}^{\lfloor n/2 \rfloor}\frac{365!n!}{i!(365-n+i)!2^{i}(n-2i)!365^{n}}$$ over various positive integer values of $n$ in MATLAB, but it obviously has very large numbers in it deriving from the factorials leading me to rearrange it as $$1-\sum_{i=0}^{\lfloor n/2 \rfloor}\prod_{j=366-n+i}^{365} \,j \,\prod_{t=n-2i+1}^{n}t\,\frac{1}{i!2^{i}365^{n}} \enspace,$$ which is leading me to get numbers rather than just inf. My current script is below, but it currently still isn't giving me a correct plot. Is my rearrangement incorrect or is the code wrong and if so how do I fix it?
for n=1:100;
i=0:floor(n/2);
j=(366-n+i):365;
t=(n-2.*i+1):n;
tosum=prod(j) * prod(t) * (1)./(factorial(i) .* (2.^i) .* (365^n));
p(n)=1-sum(tosum);
end
n=1:100;
plot(n,p)