OFFSET
1,2
COMMENTS
Multiplication and division share the same precedence level, followed by addition and subtraction at the same level. Within each precedence level, evaluation is from left to right. No parentheses are allowed.
LINKS
Michael S. Branicky, Python program for OEIS A393260
Axel Prunier, GitHub page.
FORMULA
2*n-1 <= a(n) <= 4^(n-1), arising from the number of expressing with just addition or subtraction and the number with duplicates counted, respectively.
EXAMPLE
For n=1: 1 is the only expression with value 1.
For n=2: 2+2=4, 2-2=0, 2*2=4 (not new), 2/2=1; a total of 3 distinct values.
For n=3: 3+3+3=9, 3+3-3=3, 3+3*3=12, 3+3/3=4, 3-3+3=3 (not new), 3-3-3=-3, 3-3*3=-6, 3-3/3=2, 3*3+3=12 (not new), 3*3-3=6, 3*3*3=27, 3*3/3=3 (not new), 3/3+3=4 (not new), 3/3-3=-2, 3/3*3=3 (not new), 3/3/3=1/3; a total of 11 distinct values.
PROG
(Python)
from gmpy2 import mpq
from itertools import product
def a(n):
if n == 1: return 1
s = f"mpq({n}, 1)"
return len(set(eval(s+s.join(p)+s) for p in product("+-*/", repeat=n-1)))
print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Jun 19 2026
(Python) # see Links for a faster implementation
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Axel Prunier, Mar 09 2026
EXTENSIONS
a(5)-a(15) corrected by Sean A. Irvine, May 26 2026
a(16)-a(30) from Michael S. Branicky, Jun 20 2026
a(31)-a(35) from Michael S. Branicky, Jun 24 2026
a(36) from Michael S. Branicky, Jul 03 2026
STATUS
approved
