OFFSET
1,1
COMMENTS
a(17) > 2.25*10^9. - Tyler Busby, Apr 17 2024
a(17) > 5*10^10. - Michael S. Branicky, Oct 10 2024
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
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Nov 07 2022
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Jean-Marc Falcoz, Jan 04 2009
EXTENSIONS
a(9) and a(10) from Sean A. Irvine, Dec 17 2009
a(11)-a(16) from Bert Dobbelaere, Apr 18 2019
Incorrect formula removed by Robert Israel, Oct 10 2024
STATUS
approved