Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #29 Dec 29 2024 09:30:40
%S 259146,2185871,2191530,20317438,22608949,30512946,33685085,46400839,
%T 81780856,202677438,302561193,694999138,711286401,788309388,
%U 1006626821,1105599276
%N Positive integers k equal to the sum of all the different integers formed by the digits of k (k itself excluded), keeping the order of the digits.
%C a(17) > 2.25*10^9. - _Tyler Busby_, Apr 17 2024
%C a(17) > 5*10^10. - _Michael S. Branicky_, Oct 10 2024
%e Example 1 : 10554 is not in the sequence, because
%e 0+ 1+ 4+ 5+ 10+ 14+ 15+ 54+ 55+ 104+ 105+ 154+ 155+ 554+ 1054+ 1055+ 1554 = 4893 (instead of 10554)
%e Example 2 : 259146 is in the sequence, because
%e 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
%t big = 55000000; seq = {}; i = 1;
%t f[x_] := Union[ Map[FromDigits, Subsets[IntegerDigits[x], {1, Length[IntegerDigits[x]] - 1}]]];
%t While[i < big, If[Total[f[i]] == i, Print[i]; AppendTo[seq, i]]; i++ ];
%t Print[seq]
%o (Python)
%o from itertools import combinations
%o def ok(n):
%o s, ds, ss = str(n), set(), 0
%o for d in range(len(s)-1, 0, -1):
%o for c in combinations(s, d):
%o t = int("".join(c))
%o if t not in ds:
%o ds.add(t)
%o ss += t
%o if ss > n:
%o return False
%o return n and ss == n
%o print([k for k in range(10**6) if ok(k)]) # _Michael S. Branicky_, Nov 07 2022
%Y Cf. A065794 (where the integers formed can appear several times).
%K base,nonn,more,changed
%O 1,1
%A _Jean-Marc Falcoz_, Jan 04 2009
%E a(9) and a(10) from _Sean A. Irvine_, Dec 17 2009
%E a(11)-a(16) from _Bert Dobbelaere_, Apr 18 2019
%E Incorrect formula removed by _Robert Israel_, Oct 10 2024