A296138 a(n) is the largest number m such that m = n^d_1 + n^d_2 + ... + n^d_k where d_k represents the k-th digit in the decimal expansion of m, or 0 if no such number exists.
1, 0, 12, 595968, 3909511, 0, 13177388, 1033, 10, 0, 0, 0, 0, 0, 77399307003, 1053202, 7413245658, 419370838921, 985992657240, 1347536041, 3216829919793, 1262490630568, 3606012949057, 5398293152472, 4119883235101, 0, 24006899084988, 405287637330, 15577274860798
Offset: 1
Examples
a(4) = 595968 since 595968 = 4^5 + 4^9 + 4^5 + 4^9 + 4^6 + 4^8 and it is the largest such number. It is different from A236067(4). a(5) = 3909511 since 3909511 = 5^3 + 5^9 + 5^0 + 5^9 + 5^5 + 5^1 + 5^1 and it is the largest such number. It is the same as A236067(5).
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..500
Programs
-
PARI
apply( {A296138(n)=my(m, N);while(n+m>10^m, m++); N=m; while(N*n^9>=10^N, N++); forstep(N=10^(N-!!N),10^m,-1, vecsum([n^d|d<-digits(N)])==N && return(N))}, [1..4]) \\ Naïve brute force; very slow for n > 4. - M. F. Hasler, Jul 24 2025
Comments