login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071313 a(n) is the smallest number that cannot be obtained from the numbers {1,3,...,2*n-1} using each number at most once and the operators +, -, *, /, where intermediate subexpressions must be integers. 0
2, 5, 11, 41, 92, 733, 4337, 28972, 195098, 1797746 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If noninteger subexpressions are permitted, a(5) = 122 and not 92 since 92 = (3+7)*(9 + 1/5). - Michael S. Branicky, Jul 01 2022
LINKS
Gilles Bannay, Countdown Problem
EXAMPLE
a(2)=5 because using {1,3} and the four operations we can obtain 1=1, 3-1=2, 3=3, 3+1=4 but we cannot obtain 5 in the same way.
PROG
(Python)
def a(n):
R = dict() # index of each reachable subset is [card(s)-1][s]
for i in range(n): R[i] = dict()
for i in range(1, n+1): R[0][(2*i-1, )] = {2*i-1}
reach = set(range(1, 2*n, 2))
for j in range(1, n):
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(1, 9)]) # Michael S. Branicky, Jul 01 2022
CROSSREFS
Sequence in context: A106886 A237814 A007700 * A172297 A128231 A088148
KEYWORD
hard,more,nonn
AUTHOR
Koksal Karakus (karakusk(AT)hotmail.com), Jun 11 2002
EXTENSIONS
a(10) from Michael S. Branicky, Jul 01 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)