A363802 Numbers whose digits can be interposed with one or more of the arithmetic operators +, -, *, /, with no parentheses or concatenation, to yield 10 as the result.
19, 25, 28, 37, 46, 52, 55, 64, 73, 82, 91, 109, 118, 119, 125, 127, 128, 133, 136, 137, 145, 146, 152, 154, 155, 163, 164, 172, 173, 181, 182, 190, 191, 208, 215, 217, 218, 219, 224, 226, 229, 234, 235, 242, 244, 250, 251, 253, 262, 271, 274, 280, 281, 286, 291, 298, 307
Offset: 1
Examples
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.
Programs
-
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
Comments