|
|
A249515
|
|
Numbers n for which the digital sum of n contains the same distinct digits as n itself.
|
|
4
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 199, 919, 991, 1188, 1818, 1881, 2999, 8118, 8181, 8811, 9299, 9929, 9992, 11177, 11444, 11717, 11771, 13333, 14144, 14414, 14441, 17117, 17171, 17711, 22888, 26666, 28288, 28828, 28882, 31333, 33133, 33313, 33331, 39999, 41144
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
199 is in the sequence since 1 + 9 + 9 = 19.
|
|
MATHEMATICA
|
Select[Range[1000], Union[IntegerDigits[#]] == Union[Plus@@IntegerDigits[#]] &] (* Alonso del Arte, Nov 02 2014 *)
|
|
PROG
|
(Magma) [n: n in [0..1000000] | Set(Intseq(n)) eq Set(Intseq(&+Intseq(n)))]
(PARI) for(n=0, 5*10^4, if(vecsort(digits(n), , 8) ==vecsort(digits(sumdigits(n)), , 8), print1(n, ", "))) \\ Derek Orr, Nov 02 2014
(Python)
from itertools import product
for g in range(1, 12):
....xp, ylist = [], []
....for i in range(9*g, -1, -1):
........x = set(str(i))
........if not 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 y[0] != '0' and set(y) == x and set(str(sum([int(d) for d in y]))) == x:
........................ylist.append(int(''.join(y)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|