login
A225428
Number of numbers x < 10^n such that the digits of x^2 occur with an equal frequency of 2.
5
0, 1, 9, 47, 212, 1232, 6592, 31145, 129587, 597959
OFFSET
1,3
COMMENTS
The first 47 terms of A052049 and A052050 list the numbers x. Note that n-digit numbers x must be greater than floor(sqrt(10) * 10^(n-1)). All terms after a(10) will equal a(10).
EXAMPLE
The only two-digit number is 88, whose square is 7744.
MATHEMATICA
cnt = 0; Table[x = Floor[Sqrt[10] * 10^(n-1)]; While[x < 10^n, If[Union[Last[Transpose[Tally[IntegerDigits[x^2]]]]] == {2}, cnt++]; x++]; cnt, {n, 6}]
PROG
(Python)
from collections import Counter
def passes(x): return set(Counter(str(x**2)).values()) == {2}
def afull():
c = 0
for n in range(1, 11):
c += sum(1 for x in range(10**(n-1), 10**n) if passes(x))
print(c, end=", ")
afull() # Michael S. Branicky, May 12 2023
CROSSREFS
Cf. A052049, A052050, A225429 (first differences), A226796 (single digits).
Sequence in context: A100790 A055250 A038740 * A163614 A207318 A293042
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Jun 21 2013
EXTENSIONS
a(10) from Hugo Pfoertner, May 12 2023
STATUS
approved