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.

Showing 1-2 of 2 results.

A225428 Number of numbers x < 10^n such that the digits of x^2 occur with an equal frequency of 2.

Original entry on oeis.org

0, 1, 9, 47, 212, 1232, 6592, 31145, 129587, 597959
Offset: 1

Views

Author

T. D. Noe, Jun 21 2013

Keywords

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).

Examples

			The only two-digit number is 88, whose square is 7744.
		

Crossrefs

Cf. A052049, A052050, A225429 (first differences), A226796 (single digits).

Programs

  • 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}]
  • 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

Extensions

a(10) from Hugo Pfoertner, May 12 2023

A226797 Number of n-digit numbers x such that the digits of x^2 occur with frequency 1.

Original entry on oeis.org

10, 49, 162, 220, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

T. D. Noe, Jun 21 2013

Keywords

Comments

After a(5), all terms are 0.

Examples

			All numbers 0 to 9 have squares containing only digits of frequency 1: 0, 1, 4, 9, 16, 25, 36, 49, 64, 81.
		

Crossrefs

Programs

  • Mathematica
    cnt = 0; x = 0; t2 = Table[While[x < 10^n, If[Union[Last[Transpose[Tally[IntegerDigits[x^2]]]]] == {1}, cnt++]; x++]; cnt, {n, 5}]; Differences[Join[{0}, t2]]
Showing 1-2 of 2 results.