login
A061664
a(n) is the smallest number k >= 2 for which k and k^2 contain the same digits in the same proportion in base n.
9
53, 184, 45, 9726, 3697, 30, 266, 2890, 72576, 121892, 1604132, 22423892, 31215, 61572224, 532740, 49520, 495341325, 7900478246, 19972726643, 1006557500, 1163503182, 8736, 936946009
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
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