OFFSET
0,1
LINKS
EXAMPLE
a(4) = 239 because at least 4 operators are needed to calculate this value, e.g., (5*5+9)*7+1.
PROG
(PARI) first(n)=my(op=[(x, y)->x+y, (x, y)->x*y], v=vector(n+1), t); v[1]=[1..9]; for(k=2, #v, my(u=[]); for(i=1, (k+1)\2, my(a=v[i], b=v[k-i]); t=Set(concat(apply(f->setbinop(f, a, b), op))); u=concat(u, t)); v[k]=setminus(Set(u), [0])); t=10; for(i=1, #v, while(setsearch(v[i], t), t++); v[i]=t); v;
(Python)
def aupton(nn):
alst = [10]
R = {0: set(range(1, 10))} # R[n] is set reachable using n ops
for n in range(1, nn):
R[n] = set()
for i in range((n+1)//2):
for a in R[i]:
for b in R[n-1-i]:
R[n].update([a+b, a*b])
k = 10
while k in R[n]: k += 1 # n.b. R[n-1] <= R[n] due to * by 1
alst.append(k)
return alst
print(aupton(9)) # Michael S. Branicky, Oct 19 2021
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Derek M. Jones, Apr 03 2012
EXTENSIONS
a(5)-a(7) corrected by and a(8)-a(11) from Michael S. Branicky, Oct 19 2021
STATUS
approved