Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #45 Sep 08 2022 08:46:10
%S 0,1,2,3,4,5,6,7,8,9,11111111111
%N Numbers n for which the digital sum A007953(n) and the digital product A007954(n) both contain the same distinct digits as the number n.
%C a(12) = (10^106-1)/9 + 122222222. - _Max Alekseyev_, Nov 15 2014
%C Other entries include (10^111-1)/9, (10^113-1)/9 + 177, (10^115-1)/9 + 122222222, (10^117-1)/9 + 11117, (10^125-1)/9 + 2224, (10^126-1)/9 + 333335, (10^135-1)/9 + 4666, (10^143-1)/9 + 446, (10^143-1)/9 + 2224, (10^144-1)/9 + 33335. All other entries with 150 or fewer digits are formed by permutations of the decimal digits of these entries (including a(12)). (10^((10^n-1)/9)-1)/9 are entries of the sequences for n > 1. - _Chai Wah Wu_, Nov 15 2014
%e 11111111111 is a term since A007953(11111111111) = 11 and A007954(11111111111) = 1.
%o (Magma) [n: n in [0..10^7] | Set(Intseq(n)) eq Set(Intseq(&*Intseq(n))) and Set(Intseq(n)) eq Set(Intseq(&+Intseq(n)))]
%o (PARI) is(n)=if(n<=9,return(1)); my(d=digits(n),s=Set(d)); s==Set(digits(sum(i=1,#d,d[i]))) && s==Set(digits(prod(i=1,#d,d[i]))) \\ _Charles R Greathouse IV_, Nov 13 2014
%o (Python)
%o from itertools import product
%o from operator import mul
%o from functools import reduce
%o A249517_list = [0]
%o for g in range(1,15):
%o ....xp, ylist = [], []
%o ....for i in range(9*g,-1,-1):
%o ........x = set(str(i))
%o ........if not (('0' in x) or (x in xp)):
%o ............xv = [int(d) for d in x]
%o ............imin = int(''.join(sorted(str(i))))
%o ............if max(xv)*(g-len(x)) >= imin-sum(xv) and i-sum(xv) >= min(xv)*(g-len(x)):
%o ................xp.append(x)
%o ................for y in product(x,repeat=g):
%o ....................if set(y) == x:
%o ........................yd = [int(d) for d in y]
%o ........................if set(str(sum(yd))) == x == set(str(reduce(mul, yd, 1))):
%o ............................ylist.append(int(''.join(y)))
%o ....A249517_list.extend(sorted(ylist)) # _Chai Wah Wu_, Nov 15 2014
%Y Intersection of A249515 and A249516. Subsequence of A249334.
%Y Cf. A007954, A249334, A249515, A249516.
%K nonn,base
%O 1,3
%A _Jaroslav Krizek_, Oct 31 2014
%E a(11) = 11111111111 confirmed by _Sean A. Irvine_, Nov 13 2014, by direct search.