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.
%I A372147 #10 Jun 23 2024 16:52:46 %S A372147 500,544,550,552,588,622,307172,307402,307888,308920,309480,309522, %T A372147 309604,310348,310422,310658,310754,310964,310974,310980,311206, %U A372147 311214,311342,311466,311582,311788,311790,312050,312070,312100,313022,313050,313336,313502,313512 %N A372147 Numbers k for which k and k^2 are digitally balanced numbers in base 3 (A049354). %e A372147 500 = 200112_3 and 500^2 = 250000 =110200221021_3, so 500 is a term. %e A372147 544 = 202011_3 and 544^2 = 295936 =120000221121_3, so 544 is a term. %t A372147 balQ[n_, b_] := MinMax@ Differences@ DigitCount[n, b] == {0, 0}; Select[Range[320000], balQ[#, 3] && balQ[#^2, 3] &] (* _Amiram Eldar_, Jun 03 2024 *) %o A372147 (Magma) bal:=func<n|Multiplicity(Intseq(n,3),1) eq Multiplicity(Intseq(n,3),0) and Multiplicity(Intseq(n,3),1) eq Multiplicity(Intseq(n,3),2)>; [n:n in [1..320000]|bal(n) and bal(n*n)]; %Y A372147 Cf. A049354, A353139, A353140. %K A372147 nonn,base %O A372147 1,1 %A A372147 _Marius A. Burtea_, May 23 2024