OFFSET
1,3
COMMENTS
More integers can be made if other operators are allowed (i.e., 22 = 6!/(6*6)+(6+6)/6). The sequence is finite: a(198) = 6*6*6*6*6*6 = 46656 is the last term.
See A258068 ff. for the integers that can be generated with the four basic operators and 7 7's, 8 8's, 9 9's, etc...
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..198
Wikipedia, Four Fours
EXAMPLE
49 is in the sequence: 49 = (6 + 6/6) * (6 + 6/6).
MAPLE
f:= proc(n) f(n):= `if`(n=1, {6}, {seq(seq(seq([x+y, x-y, x*y,
`if`(y=0, [][], x/y)][], y=f(n-j)), x=f(j)), j=1..n-1)})
end:
sort([select(z->z>=0 and is(z, integer), f(6))[]])[];
# Alois P. Heinz, Aug 04 2013
MATHEMATICA
f[1] = {6}; f[n_] := f[n] = Union @ Flatten @ Table[Table[Table[{x+y, x-y, x*y, If[y == 0, Null, x/y]}, {y, f[n-j]}], {x, f[j]}], {j, 1, n-1}];
Sort[Select[f[6], # >= 0 && IntegerQ[#]&]] (* Jean-François Alcover, Jun 01 2018, after Alois P. Heinz *)
PROG
(PARI) A171829(n=6, S=Vec([[n]], n))={for(n=2, n, S[n]=Set(concat(vector(n\2, k, concat([concat([[T+U, T-U, U-T, if(U, T/U), if(T, U/T), T*U] | T <- S[k]]) | U <- S[n-k]]))))); select(t-> t>=0 && denominator(t)==1, S[n])} \\ A171829() yields this sequence. Optional args allow to compute variants. - M. F. Hasler, Nov 24 2018
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Sergio Pimentel, Dec 19 2009
EXTENSIONS
Corrected and edited by Alois P. Heinz, Aug 03 2013
STATUS
approved