Let me clarify:
To score 1 point, there is 1 way, 2 points 2 ways and 3 points 4 ways (as I explained in the very first post).
This is the base case of the problem, you have to do these calculations by hand or brute force.
After that, to score 4 points for example:
it is the same as scoring 1 point + 1 shot of 3 points which makes it 1 way ( (1) + 3)
And also you can score 2 points + 1 shot of 2 points which makes them 2 ways ( (2,1-1) +2)
You can also score 3 points +1 shot of 1 point which makes them 4 ways: ( (3,2-1,1-2,1-1-1) +1)
So the total ways of score 4 points is 1+2+4=7
More generally to score n points:
let A1 bet the array of all the different ways you can score n-3 points, append the value 3 to each entry, you have now the first set to get n points
let A2 bet the array of all the different ways you can score n-2 points, append the value 2 to each entry, you have now the second set to get n points
let A3 bet the array of all the different ways you can score n-1 points, append the value 1 to each entry, you have now the third set to get n points
The total is sizeOf(A1) + sizeOf(A2) + sizeOf(A3)
Which then gives the recurrence f(n)=f(n-1)+f(n-2)+f(n-3) with base case 1,2,4 for n=1,2,3
By the way those are the
Tribonacci numbers with a different base case.