OFFSET
1,1
COMMENTS
Numbers that contain zeros trivially have this property. - Tanya Khovanova, Jul 19 2021
EXAMPLE
631 - 6*3*1 = 613 contains the same digits as 631. So 631 is a term of this sequence.
MATHEMATICA
Select[Range@5000, (d=IntegerDigits@#; FreeQ[d, 0]&&Union@IntegerDigits[#-Times@@d]==Union@d)&] (* Giorgos Kalogeropoulos, Jul 20 2021 *)
PROG
(PARI)
for(n=1, 10^4, d=digits(n); p=prod(i=1, #d, d[i]); if(p && vecsort(digits(n), , 8)==vecsort(digits(n-p), , 8), print1(n, ", ")))
(Python)
from math import prod
def ok(n):
s = str(n)
return '0' not in s and set(str(n-prod(int(d) for d in s))) == set(s)
print(list(filter(ok, range(5000)))) # Michael S. Branicky, Jul 18 2021
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Derek Orr, Oct 03 2014
STATUS
approved