OFFSET
2,1
EXAMPLE
a(9) = 2890 since 2890 = 3861 in base 9 and 2890^2 = 16638831 in base 9.
PROG
(Python)
from fractions import Fraction
from sympy.ntheory import digits
from itertools import count, islice
def f(i, j, base):
si, sj = digits(i, base)[1:], digits(j, base)[1:]
pi = [Fraction(si.count(d), len(si)) for d in range(base)]
pj = [Fraction(sj.count(d), len(sj)) for d in range(base)]
return pi == pj
def a(n): return next(k for k in count(2) if f(k, k**2, n))
print([a(n) for n in range(2, 12)]) # Michael S. Branicky, Feb 27 2023
CROSSREFS
KEYWORD
base,more,nonn
AUTHOR
Erich Friedman, Jun 16 2001
EXTENSIONS
More terms from Naohiro Nomoto, Oct 06 2001
Title clarified and a(15)-a(24) from Sean A. Irvine, Feb 27 2023
STATUS
approved