OFFSET
1,4
COMMENTS
In other words, the number of ways to achieve a score of n using at most 3 darts and finishing on a double. The maximum checkout score is 170, so this is a finite sequence.
LINKS
Carmen Bruni, Table of n, a(n) for n = 1..170
Wikipedia, Darts
PROG
(Python)
def darts(n):
if n > 170 or n <= 1:
return 0
ans = 0
singles = list(range(1, 21)) + [25]
doubles = list(map(lambda x: 2*x, singles))
triples = list(map(lambda x: 3*x, singles[:-1]))
throws = singles+doubles+triples
for i in range(len(throws)):
for j in range(len(throws)):
for k in range(len(doubles)):
dart1 = throws[i]
dart2 = throws[j]
dart3 = doubles[k]
if dart1 + dart2 + dart3 == n:
ans += 1
for j in range(len(doubles)):
dart1 = throws[i]
dart2 = doubles[j]
if dart1 + dart2 == n:
ans += 1
return ans + (n in doubles)
for i in range(1, 171):
print(darts(i))
(PARI) seq()={my(s=x*(1-x^20)/(1-x)+x^25, d=subst(s, x, x^2), g=s+d+subst(s-x^25, x, x^3)); Vecrev((1+g+g^2)*d/x)} \\ Andrew Howroyd, Nov 04 2020
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Carmen Bruni, Nov 02 2020
STATUS
approved