OFFSET
2,2
COMMENTS
Inspired by the book "Getallentheorie - Een inleiding" from Frits Beukers, pp. 103, 104 (in Dutch). Given some base b, a number can be equal to the sum of powers of its digits, where the power is equal to the number of digits of the number represented in base b.
For any base b, the number of numbers satisfying this condition is finite, and the upper bound of any number m satisfying this condition is given by m < n^a(n); i.e., a(n) is the maximum number of digits k in base n such that (d_1)^k + (d_2)^k + ... + (d_k)^k = d_1*n^(k-1) + d_2*n^(k-2) + ... + d_k.
REFERENCES
Frits Beukers, "Getallen - Een inleiding" (In Dutch), Epsilon Uitgaven, Amsterdam (2015).
EXAMPLE
a(2) = 1 since 0 = 0_2, 1 = 1_2, and for any number n larger than 1, the number of 1's in the binary representation of n is less than n.
a(3) = 2 since the largest number satisfying the condition is 8, i.e., 2^2 + 2^2 = 22_3 = 8, and thus two digits long in base 3.
Examples of numbers satisfying the condition in base 10: 1^4 + 6^4 + 3^4 + 4^4 = 1634, 9^4 + 4^4 + 7^4 + 4^4 = 9474 and 8^11 + 2^11 + 6^11 + 9^11 + 3^11 + 9^11 + 1^11 + 6^11 + 5^11 + 7^11 + 8^11 = 82693916578. However, such examples in base 10 can have up to 33 digits as an upper bound.
MATHEMATICA
result = Reap[ b = 1; While[b <= 57, {b, k, lhs, rhs} = {b + 1, 1, b - 1, b - 1}; While[lhs >= rhs, k += 1; {lhs, rhs} = {k (b - 1)^k, b^k - 1}; ]; Sow[k - 1]; ]][[2, 1]] (* James C. McMahon, Dec 19 2023 *)
PROG
(Python)
b = 1
while b <= 57:
b, k, lhs, rhs = b+1, 1, b-1, b-1
while lhs >= rhs:
k += 1
lhs, rhs = k*(b-1)**k, b**k-1
print(k-1, end = ", ")
(Python)
def A367367(n):
kmin, kmax = 1, 1
while kmax*(n-1)**kmax >= n**kmax-1:
kmax <<= 1
while True:
kmid = kmax+kmin>>1
if kmid*(n-1)**kmid < n**kmid-1:
kmax = kmid
else:
kmin = kmid
if kmax-kmin <= 1:
break
return kmin # Chai Wah Wu, Dec 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
A.H.M. Smeets, Dec 18 2023
STATUS
approved