A249517 Numbers k for which the digital sum A007953(k) and the digital product A007954(k) both contain the same distinct digits as the number k.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11111111111
Offset: 1
Examples
11111111111 is a term since A007953(11111111111) = 11 and A007954(11111111111) = 1.
Crossrefs
Programs
-
Magma
[0] cat [n: n in [0..10^7] | Set(Intseq(n)) eq Set(Intseq(&*Intseq(n))) and Set(Intseq(n)) eq Set(Intseq(&+Intseq(n)))];
-
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
-
Python
from itertools import product from operator import mul from functools import reduce A249517_list = [0] for g in range(1,15): xp, ylist = [], [] for i in range(9*g,-1,-1): x = set(str(i)) if not (('0' in x) or (x in xp)): xv = [int(d) for d in x] imin = int(''.join(sorted(str(i)))) if max(xv)*(g-len(x)) >= imin-sum(xv) and i-sum(xv) >= min(xv)*(g-len(x)): xp.append(x) for y in product(x,repeat=g): if set(y) == x: yd = [int(d) for d in y] if set(str(sum(yd))) == x == set(str(reduce(mul, yd, 1))): ylist.append(int(''.join(y))) A249517_list.extend(sorted(ylist)) # Chai Wah Wu, Nov 15 2014
Extensions
a(11) = 11111111111 confirmed by Sean A. Irvine, Nov 13 2014, by direct search.
Comments