OFFSET
1,1
COMMENTS
This sequence is a variant of a "game" you can play using the numbers on train carriages (usually 4 digits in Australia's case), ignoring prefixed zeros, preventing re-ordering of the digits and allowing only addition, subtraction, multiplication and division.
No parentheses or concatenation are allowed and expressions follow operator precedence (*/) then (+-), and left to right within the same level of precedence: "2 + 3 * 2 / 6" is 2 + ((3*2)/6) = 2 + 1 = 3.
Infinite since A052224 is a subsequence. - Michael S. Branicky, Jun 24 2023
EXAMPLE
1 + 9 = 2 + 8 = 1 * 9 + 1 = 2 * 9 - 8 = 10 so 19, 28, 191 and 298 are terms.
110 is not a term even though 1 * 10 = 10 since concatenation is disallowed.
PROG
(Python)
from itertools import product
from fractions import Fraction
def is_A363802(n):
s = [f"Fraction({d}, 1)" for d in str(n)]
for ops in product("+-*/", repeat=len(s)-1):
try: v = eval("".join(sum(zip(ops, s[1:]), (s[0], ))))
except: v = None
if v == 10: return True
return False
# Evan Gillard and Michael S. Branicky, Jun 23 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Evan Gillard, Jun 23 2023
STATUS
approved