OFFSET
1,1
COMMENTS
The rules allow one to use +, -, *, /, the given numbers and parentheses. Not all numbers need to be used. A number can be used only once. Fractions are not allowed as intermediate results.
9000 = (1 + 2)*3*4*5*50 is the largest term missing. - Charles R Greathouse IV, Sep 19 2014
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
Wikipedia, Countdown rules for numbers round
Index entries for linear recurrences with constant coefficients, signature (2,-1).
FORMULA
a(n) = n + 2359 for n >= 6642. - Alois P. Heinz, Sep 22 2014
EXAMPLE
The examples show some achievable numbers. They are not listed by a:
5 * (3 + 1) - 4 = 5 * 3 + 1 = 16.
(50 - (1 + 2) * 3) * (4 + 5) = 41 * 9 = 369.
(2 * 4) * (50 - 3 - 1) + 5 = 373.
((50 - 2) * 4 + 1) * 3 - 5 = 574.
(1 + 3 * 4) * (50 + 2) - 5 = 671.
MAPLE
with(combinat):
l:= permute([1, 2, 3, 4, 5, 50]):
b:= proc(i, j, p) option remember; global l; `if`(i=j, l[p][j],
select(x->x<>0 and is(x, integer), {seq(seq(seq([f+g, f-g,
f*g, f/g][], g=b(k+1, j, p)), f=b(i, k, p)), k=i..j-1)}))
end:
l:= sort([({$1..9000} minus {seq({seq(select(x->x>0,
b(1, t, p))[], t=2..6)}[], p=1..6!)})[]]):
a:= n-> `if`(n<=6641, l[n], n+2359):
seq(a(n), n=1..100); # Alois P. Heinz, Sep 22 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, Sep 18 2014
EXTENSIONS
More terms from Alois P. Heinz, Sep 22 2014
STATUS
approved