OFFSET
2,1
MATHEMATICA
f[k_, n_] := Block[{l = Floor[ Log[10, k] + 1], rd = RealDigits[ k^(1/n), 10, 24], id = IntegerDigits[k]}, rdd = Drop[ rd[[1]], rd[[2]]]; While[ rdd[[1]] == 0, rdd = Drop[rdd, 1]]; Take[rdd, l] == id]; g[n_] := Block[{k = 2}, While[IntegerQ[k^(1/n)] || f[k, n] == False, k++ ]; k]; Table[ g[n], {n, 2, 72}]
PROG
(Python)
import re
from sympy import perfect_power
from decimal import *
getcontext().prec = 24
def lzs(s): return len(s) - 2 - len(s[2:].lstrip('0')) # # of leading zeros
def cond(sk, sroot, k, n): # is condition true, with precision verification
if perfect_power(k, [n]): return False # decimal part should be all 0's
assert lzs(sroot) + len(sk) < len(sroot) - 3, (n, "increase precision")
return re.match("0.0*"+sk, sroot)
def a(n):
k, power = 1, Decimal(1)/Decimal(n)
rootk, sk = Decimal(k)**power, str(k)
while not cond(sk, str(rootk - int(rootk)), k, n):
k += 1
rootk, sk = Decimal(k)**power, str(k)
return k
print([a(n) for n in range(2, 73)]) # Michael S. Branicky, Aug 02 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Paul Lusch and Robert G. Wilson v, Jul 31 2004
STATUS
approved