Solution of the Week #436 - Rugby Scores

There are a couple of ways to approach this. The most obvious way is to find all of the combinations of 3,5,7 can add to 23, then work out how many permutations there are of each. There are only 4 combinations: (7,7,3,3,3), (7,5,5,3,3), (5,5,5,5,3), (5,3,3,3,3,3,3).

The first combination has 5 numbers, split into 2 of one and 3 of another, so the number of permutations is 5!/(2!3!), which is 10. Doing the same for the other combinations, you get 30, 5 and 7 permutations respectively, so 52 ways in total.

A nice clever spreadsheet shortcut that I discovered is to let a(0)=1 and for anything else a(n)=a(n-7)+a(n-5)+a(n-3).

This recursive relationship very quickly reveals that 1,2 and 4 are impossible, that a(8)=2, that a(23)=52.

To see why this works, consider the score of 23. The scores that make it up must end with either 3, 5, or 7, and so before that final score is added, you would have a score of either 16, 18 or 20. And so the number of ways of making 23 must be the sum of the number of ways of making 16, 18 or 20.

As an interesting footnote, the smallest n for which a(n) requires a further digit follows an interesting pattern:

a(16)=10

a(26)=102

a(36)=1045

a(46)=10806

a(56)=112131

a(66)=1164641

a(76)=12098938

a(86)=125695132

But that’s where the pattern ends, as a(95) gives a ten-digit number of ways.