A355377 Numbers k such that the concatenation of digits included in the sum and product of the digits of the number k is an anagram of the number k, and digits of the number are sorted in nondecreasing order.
119, 1236, 11359, 11449, 122669, 2334699, 13346899
Offset: 1
Examples
11359 is a term since 1+1+3+5+9 = 19, 1*1*3*5*9 = 135, and 19135 is an anagram of 11359.
Crossrefs
Cf. A062237.
Programs
-
Python
import math def is_ok(num): nums = [int(i) for i in str(num)] summa = sum(nums) prods = math.prod(nums) syms_1 = [str(i) for i in nums] syms_2 = [i for i in str(summa)] + [i for i in str(prods)] if syms_1 == sorted(syms_2): return True return False
-
Python
from math import prod from itertools import count, islice, combinations_with_replacement as mc def c(s): d = list(map(int, s)) return sorted(s) == sorted(str(sum(d)) + str(prod(d))) def ndgen(d): yield from ("".join(m) for m in mc("123456789", d)) def agen(): yield from (int(s) for d in count(1) for s in ndgen(d) if c(s)) print(list(islice(agen(), 7))) # Michael S. Branicky, Jun 30 2022
Comments