OFFSET
0,1
COMMENTS
The A309886 is a similar sequence, except: there we allow intermediate fractions, and we require all numbers to be used when building an expression. - Matej Veselovac, Aug 28 2019
For n>=2, the largest number that can be obtained in this manner is given by the following formula: (2^1 + 2^0)*(Product_{k=2..n} 2^k). This product notation is equivalent to the expression: (3/2)*2^(n*(n+1)/2). Thus, for n>=2, this sequence has an upper bound: (3/2)*2^(n*(n+1)/2) + 1. - Alejandro J. Becerra Jr., Apr 22 2020
FORMULA
a(n) <= A309886(n+1). - Michael S. Branicky, Jul 15 2022
EXAMPLE
a(2) = 11 because using {1,2,4} and the four operations we can obtain all the numbers up to 10, for example 10=(4+1)*2, but we cannot obtain 11 in the same way.
a(6) <= 595 since the only way to make 595 is: (1 + 16 + 4/8)*(2 + 32), which requires the use of an intermediate fraction 4/8 in the calculation process, which is not allowed. - Matej Veselovac, Aug 28 2019
a(8) != 19351 = 1+(2+256)*(((4+16)*(128-8))/32). - Michael S. Branicky, Jul 15 2022
PROG
(Python)
def a(n):
R = dict() # index of each reachable subset is [card(s)-1][s]
for i in range(n+1): R[i] = dict()
for i in range(n+1): R[0][(2**i, )] = {2**i}
reach = set(2**i for i in range(n+1))
for j in range(1, n+1):
for i in range((j+1)//2):
for s1 in R[i]:
for s2 in R[j-1-i]:
if set(s1) & set(s2) == set():
s12 = tuple(sorted(set(s1) | set(s2)))
if s12 not in R[len(s12)-1]:
R[len(s12)-1][s12] = set()
for a in R[i][s1]:
for b in R[j-1-i][s2]:
allowed = [a+b, a*b, a-b, b-a]
if a != 0 and b%a == 0: allowed.append(b//a)
if b != 0 and a%b == 0: allowed.append(a//b)
R[len(s12)-1][s12].update(allowed)
reach.update(allowed)
k = 1
while k in reach: k += 1
return k
print([a(n) for n in range(6)]) # Michael S. Branicky, Jul 15 2022
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Koksal Karakus (karakusk(AT)hotmail.com), Jun 11 2002
EXTENSIONS
a(8) corrected by Michael S. Branicky, Jul 15 2022
STATUS
approved