cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

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