%I #13 Feb 27 2023 20:30:07
%S 53,184,45,9726,3697,30,266,2890,72576,121892,1604132,22423892,31215,
%T 61572224,532740,49520,495341325,7900478246,19972726643,1006557500,
%U 1163503182,8736,936946009
%N 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.
%e a(9) = 2890 since 2890 = 3861 in base 9 and 2890^2 = 16638831 in base 9.
%o (Python)
%o from fractions import Fraction
%o from sympy.ntheory import digits
%o from itertools import count, islice
%o def f(i, j, base):
%o si, sj = digits(i, base)[1:], digits(j, base)[1:]
%o pi = [Fraction(si.count(d), len(si)) for d in range(base)]
%o pj = [Fraction(sj.count(d), len(sj)) for d in range(base)]
%o return pi == pj
%o def a(n): return next(k for k in count(2) if f(k, k**2, n))
%o print([a(n) for n in range(2, 12)]) # _Michael S. Branicky_, Feb 27 2023
%Y Cf. A061656, A061657, A061658, A061659, A061660, A061661, A061662, A061663, A114258.
%K base,more,nonn
%O 2,1
%A _Erich Friedman_, Jun 16 2001
%E More terms from _Naohiro Nomoto_, Oct 06 2001
%E Title clarified and a(15)-a(24) from _Sean A. Irvine_, Feb 27 2023
|