|
|
A153980
|
|
Positive integers n equal to the sum of all the different integers formed by the digits of n (n itself excluded), keeping the order of the digits.
|
|
1
|
|
|
259146, 2185871, 2191530, 20317438, 22608949, 30512946, 33685085, 46400839, 81780856, 202677438, 302561193, 694999138, 711286401, 788309388, 1006626821, 1105599276
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Example 1 : 10554 is not in the sequence, because
0+ 1+ 4+ 5+ 10+ 14+ 15+ 54+ 55+ 104+ 105+ 154+ 155+ 554+ 1054+ 1055+ 1554 = 4893 (instead of 10554)
Example 2 : 259146 is in the sequence, because
1+ 2+ 4+ 5+ 6+ 9+ 14+ 16+ 21+ 24+ 25+ 26+ 29+ 46+ 51+ 54+ 56+ 59+ 91+ 94+ 96+ 146+ 214+ 216+ 246+ 251+ 254+ 256+ 259+ 291+ 294+ 296+ 514+ 516+ 546+ 591+ 594+ 596+ 914+ 916+ 946+ 2146+ 2514+ 2516+ 2546+ 2591+ 2594+ 2596+ 2914+ 2916+ 2946+ 5146+ 5914+ 5916+ 5946+ 9146+ 25146+ 25914+ 25916+ 25946+ 29146+ 59146 = 259146
|
|
MATHEMATICA
|
big = 55000000; seq = {}; i = 1;
f[x_] := Union[ Map[FromDigits, Subsets[IntegerDigits[x], {1, Length[IntegerDigits[x]] - 1}]]];
While[i < big, If[Total[f[i]] == i, Print[i]; AppendTo[seq, i]]; i++ ];
Print[seq]
|
|
PROG
|
(Python)
from itertools import combinations
def ok(n):
s, ds, ss = str(n), set(), 0
for d in range(len(s)-1, 0, -1):
for c in combinations(s, d):
t = int("".join(c))
if t not in ds:
ds.add(t)
ss += t
if ss > n:
return False
return n and ss == n
|
|
CROSSREFS
|
Cf. A065794 (where the integers formed can appear several times), A154781.
|
|
KEYWORD
|
base,nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|