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.

A154532 a(n) is the largest 10-digit number whose n-th power contains each digit (0-9) n times, or -1 no such number exists.

Original entry on oeis.org

9876543210, 9994363488, 9999257781, 9999112926, 9995722269, 9999409158, 9998033316, 9993870774, 9986053188, 9964052493, 9975246786, 9966918135, 9938689137, 9998781633, 9813743148, 9970902252, 9740383767, 9829440591, 9873773268, 9985819785, 9766102146, 9863817738
Offset: 1

Views

Author

Zhining Yang, Jan 11 2009

Keywords

Comments

A number with 10*n digits may have all ten digits (0-9) repeated n times. The probability of this is (10n)!/((n!)^10 * 10^((10*n)-10^(10*n-1)). There are 10^10-10^(10-1/n)) numbers which are n-th powers of 10-digit numbers. So there may exist Count=(10n)!*(10^10-10^(10-1/n)))/((n!)^10 * 10^((10*n)-10^(2*n-1)) numbers with the desired property.
From a(23) to a(110) the only terms which exist are a(24)=9793730157, a(26)=9347769564, a(35)=9959167017, and a(38)=9501874278. (The other values of a(n) are -1.) - Zhining Yang, Oct 05 2022

Examples

			a(18) = 9829440591, so each digit (0-9) appears 18 times in the decimal expansion of 9829440591^18.
		

Crossrefs

Programs

  • Python
    def flag(p, n):
        b = True
        for i in range(10):
            if not p.count(str(i)) == n:
                b = False
                break
        return b
    def a(n):
        for i in range(10 ** 10 - 1, 3 * int(10 ** (10 - 1 / n) / 3), -3):
            p = str(i ** n)
            if flag(p, n) == True:
                return i
                break
    for i in range(1, 23):
        print(i, a(i))  # Zhining Yang, Oct 10 2022
    
  • Python
    def flag(p, n):
        return all(p.count(d) == n for d in "0123456789")
    def a(n):
        return next(i for i in range(10**10-1,3*int(10**(10-1/n)/3), -3) if flag(str(i**n), n))
    for i in range(2, 23):
        print(i,a(i))  # Michael_S._Branicky, Oct 10 2022

Extensions

Edited by N. J. A. Sloane, Jan 12 2009
a(19)-a(22) from Zhining Yang, Oct 05 2022
Definition revised by N. J. A. Sloane, Nov 22 2022