I assume we're using the same convention as in the earlier question, and ignoring order. So we're looking for partitions of $n$ into numbers from {1,2,3,4,5} with the restriction that we can't have a 4 or 5 unless we also have at least two from {2,3}.
[EDITED to add:] In what follows I assume that we care about the patterns of scores rather than how they were obtained. This matters only in one way: a 2 can be either a win when you aren't on a winning streak, or a draw when you are (which necessarily ends that streak). I neglected that because I forgot about it, but if I'd remembered I would probably still have neglected it, because I think dealing with it "properly" is going to make what's already a messy calculation with a messy answer downright intolerable. [EDITED again to add:] OP has now very obligingly edited the question to make this explicitly permitted.
It's probably best to think of this as the number of partitions of $n$ into numbers from {1,2,3,4,5} unrestrictedly, minus the number of partitions that use at most one 2 or 3 and at least one 4 or 5. Then split that correction term up as follows: no 2 or 3, but at least one 4 or 5 (= partitions into {1,4,5} minus partitions into {1}); just one 2, but at least one 4 or 5 (= same thing but for $n-2$ instead of $n$); just one 3, but at least one 4 or 5 (= same thing but for $n-3$).
In other words, we want (with what I hope is obvious notation) $p_{12345}(n)-(p_{145}(n)-p_1(n))-(p_{145}(n-2)-p_1(n-2))-(p_{145}(n-3)-p_1(n-3))$. Obviously $p_1(n)=1$ provided $n\geq0$, and $p_{\textrm{anything}}(\textrm{negative})=0$, so we can write this as $p_{12345}(n)-p_{145}(n)-p_{145}(n-2)-p_{145}(n-3)+[n\geq0]+[n\geq2]+[n\geq3]$ where $[P]$ means 1 if $P$ and 0 if not-$P$.
Now, this stuff is not trivial. It turns out, at least according to one book on the subject, that $p_{12345}(n)$ is the nearest integer to ...
$\frac{(n+8)\left(n^3+22n^2+44n+180\left\lfloor\frac{n}2\right\rfloor+248\right)}{2880}$
which doesn't entirely inspire me with optimism about there being a very nice formula for $p_{145}(n)$, but let's see. $p_{145}(n)$ is the number of ways to make $n$ out of 1s, 4s, and 5s. The generating function $\sum p_{145}(n)q^n$ equals $\frac1{(1-q)(1-q^4)(1-q^5)}$. We can turn that into partial fractions and play around a bit, and if I haven't messed it up -- you really don't want to see the details -- it turns out that $p_{145}(n)$ is usually the nearest integer to $\frac{(n+5)^2}{40}$, except that if the remainder on dividing $n$ by 20 is one of {3,5,7} we need to add {-1,+1,-1} respectively.
OK. So, putting all this together, if I haven't messed up my calculations, then to find the number of ways to score $n$ in $n$ games you do this:
First of all, find the nearest integer to $\frac{(n+8)\left(n^3+22n^2+44n+180\left\lfloor\frac{n}2\right\rfloor+248\right)}{2880}$. If $n$ is {0,1,2,more} then add {1,1,2,3}. Then subtract $f(n)+f(n-2)+f(n-3)$ where $f(m)$ is zero if $m<0$ and otherwise is the nearest integer to $\frac{(m+5)^2}{40}$ plus a correction that if $m$ mod 20 is {3,5,7,other} is {-1,+1,-1,0}.
There's maybe a 20% chance that I haven't made any errors in working all that out.
[EDITED to add:] It looks like I got lucky! Here's some Python code implementing (1) the formula above and (2) a brute-force enumeration. First, brute force:
def enumerate_limited_partitions(n,k):
# enumerate k-tuples (#1, #2, ..., #k)
if n<0: return
if n==0:
yield k*(0,)
return
if k==1:
yield (n,)
return
for m in range(n//k+1):
for p in enumerate_limited_partitions(n-k*m,k-1): yield p+(m,)
def allowed(p):
streaky = (p[1]+p[2] >= 2)
return streaky or (p[3]==0 and p[4]==0)
def count(n):
return sum(allowed(p) for p in enumerate_limited_partitions(n,5))
Second, the formula above:
def p12345(n):
if n<0: return 0
return int(round((n+8)*(n**3+22*n**2+44*n+180*(n//2)+248)/2880))
def p145(n):
if n<0: return 0
m = n%20
if m==3 or m==7: delta=-1
elif m==5: delta=+1
else: delta=0
return round((n+5)**2/40) + delta
def gareth(n):
if n<0: return 0
t = p12345(n)
if n<=1: t+=1
elif n==2: t+=2
else: t+=3
return t - p145(n) - p145(n-2) - p145(n-3)
For n from 1 to 40, these both give the following results:
1, 2, 3, 4, 5, 7, 8, 11, 15, 20,
25, 32, 40, 51, 62, 76, 91, 110, 130, 154,
180, 210, 242, 280, 320, 366, 414, 469, 528, 594,
663, 740, 822, 913, 1008, 1113, 1223, 1344, 1471, 1609