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
KEYWORD
nonn,base,new
AUTHOR
Ali Sidheek, Jun 05 2026
STATUS
approved
