login
A396781
a(n) is the largest integer of the form r^k (with 0 < r < n and k > 0) whose base-n digital root is r, and whose number of digits in base-n is k.
0
1, 4, 81, 16384, 1953125, 2176782336, 4747561509943, 18014398509481984, 109418989131512359209, 10000000000000000000000000, 144209936106499234037676064081, 34182189187166852111368841966125056, 972786042517719014174576083150881262357, 500026926136478545004035990584179037499817984
OFFSET
2,2
EXAMPLE
a(2) = 1: the only solution is 1 (base 2: "1", r=1, k=1).
a(3) = 4: the solutions are 1, 2, and 4. The maximum is 4 (base 3: "11", r=2, k=2).
a(4) = 81: the solutions are 1, 2, 3, 9, 27, and 81. The maximum is 81 (base 4: "1101", r=3, k=4).
a(10) = 109418989131512359209: this is the maximum value found in base 10, corresponding to 9^21.
PROG
(Python)
import numpy as np
def f(n, b):
if n == 0: return 1
d = []
t = abs(n)
while t > 0:
d.append(t % b)
t //= b
return len(d)
def r(n, b):
if n == 0: return 0
return 1 + ((n - 1) % (b - 1))
def s(m=19):
o = []
for b in range(2, m + 1):
v = [1]
for i in range(2, b):
k_max = int(np.floor(1 / (1 - (np.log(i) / np.log(b)))))
for k in range(1, k_max + 1):
n = int(i**k)
if f(n, b) == k and r(n, b) == i:
v.append(n)
o.append(str(max(v)))
print(", ".join(o))
s(19)
CROSSREFS
Cf. A394570.
Sequence in context: A394969 A324088 A357513 * A090599 A133396 A233001
KEYWORD
nonn,base,new
AUTHOR
Ali Sidheek, Jun 05 2026
STATUS
approved