login
Integers m for which m = Sum (d_i - 1)^k, where m is k decimal digits long and d_i are the digits of m.
1

%I #32 Feb 05 2025 22:17:03

%S 26,126,217,729,4193,134068,10875747,24228197,2491591748,

%T 106557756999043

%N Integers m for which m = Sum (d_i - 1)^k, where m is k decimal digits long and d_i are the digits of m.

%C Terms have <= 24 digits since 25*8^25 < 10^24. Full sequence is listed. - _Chai Wah Wu_, Feb 05 2025

%e 134068 is a term since it is k=6 digits long and its digit powers are (1-1)^6 + (3-1)^6 + (4-1)^6 + (0-1)^6 + (6-1)^6 + (8-1)^6 = 134068.

%p with(numtheory): P:=proc(q) local a, b, d, k, n;

%p for n from 1 to q do a:=convert(n,base,10); d:=length(n)

%p if add((a[k]-1)^d,k=1..d)=n then print(n); fi; od; end: P(3*10^7);

%t Select[Range[150000], # == Sum[(Part[IntegerDigits[#], l] - 1)^IntegerLength[#],{l, IntegerLength[#]}] &] (* _Stefano Spezia_, Feb 04 2025 *)

%o (PARI) isok(m) = my(d=digits(m), k=#d); m == sum(i=1, k, (d[i]-1)^k); \\ _Michel Marcus_, Feb 04 2025

%o (Python)

%o from itertools import chain, combinations_with_replacement, islice

%o def A380810_gen(): # generator of terms

%o yield from chain.from_iterable(sorted(map(lambda s:sum((int(d)-1)**l for d in s),sorted(filter(lambda s:sorted(str(m:=sum((int(d)-1)**l for d in s)))==list(s) and 10**l>m>=10**(l-1),combinations_with_replacement('0123456789',l))))) for l in range(1,25))

%o A380810_list = list(islice(A380810_gen(),10)) # _Chai Wah Wu_, Feb 05 2025

%Y Cf. A005188, A261433.

%K nonn,base,fini,full

%O 1,1

%A _Paolo P. Lava_, Feb 04 2025

%E a(9)-a(10) from _Chai Wah Wu_, Feb 05 2025