OFFSET
1,1
COMMENTS
Derived from the Numbers game from the British game show Countdown.
LINKS
DataGenetics blog, Countdown's Numbers Game
EXAMPLE
1 = 4 / 4
2 = (4 + 4) / 4
3 = 4 - (4 / 4)
... ...
25 = (4 * 4) + 4 + 4 + (4 / 4)
26 cannot be solved
27 = ((4 + 4) * 4) - 4 - (4 / 4)
MATHEMATICA
ops = {Plus, Subtract, Times, Divide}; ex[w_] := Block[{s = {}}, Do[If[e==0, AppendTo[s, 4], s[[-2]] = Quiet[s[[-2]]~ops[[e]]~s[[-1]]]; s = Most[s]], {e, w}]; s[[1]]]; ric[w_, tg_, no_, n4_, trg_] := Block[{v}, If[tg == 0, v = ex[w]; If[Quiet[v >= 0 && IntegerQ[v]], Sow[v]], If[n4 < trg, ric[Append[w, 0], tg-1, no, n4+1, trg]]; If[no < n4-1, Do[ric[Append[w, j], tg-1, no+1, n4, trg], {j, 4}]]]]; do[n4_] := Union[Reap[ric[{}, 2*n4-1, 0, 0, n4]][[2, 1]]]; Complement[ Range[0, 150], Union @@ Array[do, 6]] (* Giovanni Resta, Nov 01 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Hong Shao Yang (hongsy2006(AT)gmail.com), Dec 17 2009
EXTENSIONS
More terms from Giovanni Resta, Nov 01 2019
STATUS
approved