cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A185352 The "smallest countdown" numbers are the smallest positive integer that cannot be made using the numbers n through 1, in order, using the operations +, -, *, /, and parentheses.

This page as a plain text file.
%I A185352 #38 Jun 08 2024 15:44:07
%S A185352 2,4,8,17,39,92,275,922,2894,10843,35944
%N A185352 The "smallest countdown" numbers are the smallest positive integer that cannot be made using the numbers n through 1, in order, using the operations +, -, *, /, and parentheses.
%C A185352 Inspired by a now-lost blog post in which someone discussed a "new year's countdown" equation for 2012, e.g., 10 * (9 + ((8 * (((7 + (6 / (5 * 4))) * 3) + 2)) + 1)) = 2012. This sequence has been "verified" by two independently created programs.
%e A185352 for n = 3, a(3) = 8, because 3*2+1=7, and 3*(2+1)=9, but there is no equation with 3,2,and 1 in order that equals 8. Note that if we allow the order to change, we can make 8, because 2*(3+1)=8, but reordering is not allowed.
%o A185352 (Python)
%o A185352 from fractions import Fraction
%o A185352 def genAllTrees(l):
%o A185352     if len(l) == 0:
%o A185352         return
%o A185352     elif len(l) == 1:
%o A185352         yield l[0], str(l[0])
%o A185352     else:
%o A185352         for middle in range(len(l)):
%o A185352             for lval, leqn in genAllTrees(l[:middle]):
%o A185352                 for rval, reqn in genAllTrees(l[middle:]):
%o A185352                     yield lval+rval, ("(" + leqn + " + " + reqn + ")")
%o A185352                     yield lval-rval, ("(" + leqn + " - " + reqn + ")")
%o A185352                     yield lval*rval, ("(" + leqn + " * " + reqn + ")")
%o A185352                     if rval != Fraction(0):
%o A185352                         yield lval/rval, ("(" + leqn + " / " + reqn + ")")
%o A185352 def findSmallestIntNotPresent(n):
%o A185352     vals = {}
%o A185352     for val, eqn in genAllTrees([Fraction(i) for i in range(n, 0, -1)]):
%o A185352         if val.denominator == 1:
%o A185352             val = val.numerator
%o A185352             if val not in vals:
%o A185352                 vals[val] = eqn
%o A185352     i = 1
%o A185352     while i in vals:
%o A185352         i += 1
%o A185352     return i
%o A185352 for i in range(1, 11):
%o A185352     print(i, findSmallestIntNotPresent(i))
%Y A185352 Related to A060315, which is the smallest number that cannot be made with the numbers 1 to n, in any order.
%K A185352 nonn,hard,more
%O A185352 1,1
%A A185352 _Peter Boothe_ and Abraham Asfaw, Feb 08 2012
%E A185352 a(10)-a(11) from _Hiroaki Yamanouchi_, Oct 04 2014