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-10 of 10 results.

A154566 Smallest 10-digit number whose n-th power contains each digit (0-9) n times, or -1 if no such number exists.

Original entry on oeis.org

1023456789, 3164252736, 4642110594, 5623720662, 6312942339, 6813614229, 7197035958, 7513755246, 7747685775, 7961085846, 8120306331, 8275283289, 8393900487, 8626922994, 8594070624, 8691229761, 8800389678, 8807854905, 9873773268, 8951993472, 9473643936, 9585032094
Offset: 1

Views

Author

Zhining Yang, Jan 12 2009, Jan 13 2009

Keywords

Comments

A number with 10*n digits could contain all ten digits(0-9) 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 some 10-digit numbers. So there are about (10n)!*(10^10-10^(10-1/n)))/((n!)^10 * 10^((10*n)-10^(10*n-1)) numbers which satisfy the requirements.
Fortunately, I found a larger number than those shown here, for n=26, a(n)=9160395852. Since (10n)!*(10^10-10^(10-1/n))/((n!)^10 * 10^((10*n)-10^(10*n-1)) = 0.31691419..., this is a lucky event!
The sequence is -1 beyond a certain point because when n > 23025850928 we have 9999999999^n < 10^(10*n-1), i.e., it is impossible to obtain a power with 10*n digits. From a(23) to a(600) the only terms which are not -1 are a(24)=9793730157, a(26)=9160395852, a(35)=9959167017, and a(38)=9501874278. - Giovanni Resta, Jan 17 2020

Examples

			For n=18, a(n)=8807854905. That means 8807854905^18 has all digits 0-9 each 18 times and 8807854905 is the smallest 10-digit number which has this property.
		

Crossrefs

Programs

  • Python
    def flag(p, n):
        for i in range(10):
            if not p.count(str(i)) == n:
                return False
        return True
    def a(n):
        for i in range(3*int(10**(10-1/n)/3), 10**10, 3):
            if flag(str(i**n), n):
                return i
    for i in range(1, 41):
        print(a(i), end=", ") # Zhining Yang, Oct 05 2022
  • VBA
    Function Flag(ByVal s As String, ByVal num As Long) As Long
    Dim b&(9), t&, i&
    Flag = 1
    If Len(s) <> 10 * num Then
        Flag = 0
        Exit Function
    End If
    For i = 1 To Len(s)
        t = Val(Mid(s, i, 1))
        b(t) = b(t) + 1
        If b(t) > num Then
            Flag = 0
            Exit Function
        End If
    Next
    End Function
    '
    Function Mypower(ByVal num As Currency, ByVal power As Long) As String
    Dim b(), temp, i&, j&
    ReDim b(1 To 2 * power)
    ReDim s(1 To 2 * power)
    b(2 * power - 1) = Val(Left(num, 5))
    b(2 * power) = Val(Right(num, 5))
    For i = 2 To power
        temp = 0
        For j = 2 * power To 1 Step -1
            temp = b(j) * num + temp
            b(j) = Format(Val(Right(temp, 5)), "00000")
            temp = Int(temp / 10 ^ 5)
        Next
    Next
    Mypower = Join(b, "")
    End Function
    '
    Function a(ByVal n As Long)
    Dim j As Currency, s As String, num&
    For j = 3 * Int(1 + 10 ^ (10 - 1 / n) / 3) To 9999999999# Step 3
        DoEvents
        If Flag(Mypower(j, n), n) = 1 Then
            a = j
            Exit Function
        End If
    Next
    End Function ' Zhining Yang, Oct 11 2022
    

Extensions

Edited by N. J. A. Sloane, Jan 13 2009
Edited by Charles R Greathouse IV, Nov 01 2009
Further edits by M. F. Hasler, Oct 05 2012
a(19)-a(22) from Giovanni Resta, Jan 17 2020
Added escape clause to definition. - N. J. A. Sloane, Nov 22 2022

A154871 Numbers n such that n^6 contains every digit exactly 4 times.

Original entry on oeis.org

3470187, 3554463, 3887058, 4328241, 4497738
Offset: 1

Views

Author

Zhining Yang, Jan 16 2009

Keywords

Comments

a(1) is also the number of A074205

Examples

			3887058^6=3449261536602702380309782557611971988544, which contains 4 times of each digit 0-9. Total 5 terms
		

Crossrefs

A154873 Numbers n such that n^5 contains every digit exactly 3 times.

Original entry on oeis.org

643905, 680061, 720558, 775113, 840501, 878613, 984927
Offset: 1

Views

Author

Zhining Yang, Jan 16 2009

Keywords

Comments

a(5) is also the number of A074205

Examples

			840501^5=419460598737334268928156702501, which contains exactly 3 times of each digit 0-9. Total 7 terms
		

Crossrefs

Programs

  • Mathematica
    Select[Range[630972,999978],Union[DigitCount[#^5]]=={3}&] (* Harvey P. Dale, May 01 2021 *)

A154874 Numbers k such that k^3 contains every digit exactly twice.

Original entry on oeis.org

2158479, 2190762, 2205528, 2219322, 2301615, 2330397, 2336268, 2345811, 2358828, 2359026, 2367609, 2388534, 2389119, 2389638, 2397132, 2428986, 2504736, 2524974, 2536152, 2583258, 2590125, 2607222, 2620827, 2622012, 2647866, 2649369, 2658636, 2671593
Offset: 1

Views

Author

Zhining Yang, Jan 16 2009

Keywords

Comments

This sequence has 138 terms.

Examples

			2358828^3 = 13124683009764879552, which contains each digit 0..9 exactly twice.
		

Crossrefs

Programs

  • Maple
    lim:=floor((10^20)^(1/3)): for j from ceil((10^19)^(1/3)) to lim do d:=convert(j^3,base,10): doubdig:=true: for k from 0 to 9 do if(numboccur(d,k)<>2)then doubdig:=false:break: fi: od: if(doubdig)then print(j); fi: od: # Nathaniel Johnston, May 28 2011
  • Mathematica
    With[{cmin=Ceiling[Surd[10^19,3]],cmax=Floor[Surd[10^20,3]]},Select[ Range[ cmin, cmax], Union[ DigitCount[#^3]]=={2}&]] (* Harvey P. Dale, Nov 17 2018 *)

A154818 Numbers k such that k^4 contains every digit exactly twice.

Original entry on oeis.org

69636, 70215, 77058, 80892
Offset: 1

Views

Author

Zhining Yang, Jan 15 2009

Keywords

Comments

77058^4 = 35259076387041812496, which contains 2 of each digit 0-9. There are just 4 terms.

Crossrefs

Extensions

Keywords fini and full added. - R. J. Mathar, Jan 17 2009

A357755 Number of solutions for a 10-digit number whose n-th power contains each digit (0-9) exactly n times.

Original entry on oeis.org

3265920, 468372, 65663, 15487, 5020, 1930, 855, 417, 246, 114, 97, 45, 33, 24, 20, 18, 7, 6, 1, 3, 2, 3, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1
Offset: 1

Views

Author

Zhining Yang, Nov 26 2022

Keywords

Comments

A number with 10*n digits may have all ten digits (0-9) repeated n times. The probability of this is (10*n)!/((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 = (10*n)!*(10^10-10^(10-1/n))/((n!)^10 * (10^(10*n)-10^(10*n-1))) numbers with the desired property.
No solutions were found for n = 39 to 1000.

Examples

			a(20) = 3 because there are 3 10-digit numbers (8951993472, 9921107394, and 9985819785) whose 20th power contains each digit (0-9) 20 times.
		

Crossrefs

Programs

  • Python
    def flag(p, n):
        return all(p.count(d) == n for d in "0123456789")
    def a(n):
        num=0
        for i in range(10**10-1, 3*int(10**(10-1/n)/3), -3):
            if flag(str(i**n), n):
                num+=1
        return(num)

A154875 Numbers k such that k^4 contains every digit exactly 3 times.

Original entry on oeis.org

17824719, 17940018, 18027474, 18197931, 18326025, 18798396, 18915888, 18929424, 19027455, 19149462, 19180275, 19196064, 19235673, 19311297, 19322913, 19324275, 19328322, 19455918, 19522575, 19757886, 19793664
Offset: 1

Views

Author

Zhining Yang, Jan 16 2009

Keywords

Examples

			22807116 ^ 4 = 270571148920443982076865351936, which contains exactly 3 times of each digit 0-9.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[17824000,31608000],Union[Tally[IntegerDigits[#^4]][[All,2]]]=={3}&] (* Harvey P. Dale, Dec 24 2016 *)
  • PARI
    is(n) = my(v=vector(10), d=digits(n^4)); if(#d!=30,return(0)); for(i=1, #d, v[d[i]+1]++; if(v[d[i]+1] > 3, return(0))); 1 \\ David A. Corneth, Aug 19 2025

A370667 Largest pandigital number whose n-th power contains each digit (0-9) exactly n times.

Original entry on oeis.org

9876543210, 9876124053, 9863527104, 9846032571, 9847103256, 9247560381
Offset: 1

Views

Author

Zhining Yang, Mar 13 2024

Keywords

Comments

If an n-th power of a pandigital number k contains each digit (0-9) exactly n times, it implies that 10^(10 - 1/n) <= 9876543210, so n <= 185. It's easy to verify that no solutions exist for n=7 to 185.

Examples

			a(4) = 9846032571 because it is the largest 10-digit number that contains each digit (0-9) exactly once and its 4th power 9398208429603554221689707364750715341681 contains each digit (0-9) exactly 4 times.
		

Crossrefs

Programs

  • Mathematica
    s=FromDigits/@Permutations[Range[0,9]];For[n=1,n<=6,n++,For[k=Length@s,k>0,k--,If[Count[Tally[IntegerDigits[s[[k]]^n]][[All,2]],n]==10,Print[{n,s[[k]]}];Break[]]]]
  • Python
    from itertools import permutations
    a=[]
    for n in range(1,7):
        for k in [int(''.join(d)) for d in permutations('9876543210', 10)]:
            if all(str(k**n).count(d) ==n for d in '0123456789'):
                a.append(k)
                break
    print(a)

A154876 10-digit numbers n such that n^16 contains every digit exactly 16 times.

Original entry on oeis.org

8691229761, 8776040742, 8800099059, 8812428855, 8813522223, 8815323864, 8823675177, 8886940968, 9239038038, 9324907263, 9480130515, 9500938647, 9643844169, 9801034758, 9857840688, 9872688021, 9962545842, 9970902252
Offset: 1

Views

Author

Zhining Yang, Jan 16 2009

Keywords

Comments

The search program was provided by wuxinren(http://bbs.emath.ac.cn/space-uid-80.html): http://bbs.emath.ac.cn/attachment.php?aid=697&k=37ef434325a887e1a6f268d69d06192a&t=1232126232

Examples

			8691229761^16=1059984945135973085116625441940958734567890938937942910046410302827750560860737374626331724228885721853160790705924439371252226476405367618058329962361885148161 means that 16th power of 8691229761 has all digit(0-9) each for 16 times exactly
		

Crossrefs

A371469 Least pandigital number whose n-th power contains each digit (0-9) exactly n times.

Original entry on oeis.org

1023456789, 3175462089, 4680215379, 5702631489, 7351062489, 7025869314
Offset: 1

Views

Author

Zhining Yang, Apr 01 2024

Keywords

Comments

If an n-th power of a pandigital number k contains each digit (0-9) exactly n times, it implies that 10^(10 - 1/n) <= 9876543210, so n <= 185. It's easy to verify that no solutions exist for n=7 to 185.
For the largest pandigital number whose n-th power contains each digit (0-9) exactly n times, see A370667.

Examples

			a(4) = 5702631489 because it is the least 10-digit number that contains each digit (0-9) exactly once and its 4th power 1057550783692741389295697108242363408641 contains each digit (0-9) exactly 4 times.
		

Crossrefs

Programs

  • Mathematica
    s = FromDigits /@ Permutations[Range[0, 9]]; For[n = 1, n < 7, n++,
     For[k = 1, k <= Length@s, k++,
      If[Count[Tally[IntegerDigits[s[[k]]^n]][[All, 2]], n] == 10,
       Print[{n, s[[k]]}]; Break[]]]]
  • Python
    from itertools import permutations as per
    a=[]
    for n in range(1,7):
        for k in [int(''.join(d)) for d in per('0123456789', 10)]:
            if all(str(k**n).count(d) ==n for d in '0123456789'):
                a.append(k)
                break
    print(a)
Showing 1-10 of 10 results.