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

A052046 Squares whose digits occur with the same frequency.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 169, 196, 256, 289, 324, 361, 529, 576, 625, 729, 784, 841, 961, 1024, 1089, 1296, 1369, 1764, 1849, 1936, 2304, 2401, 2601, 2704, 2809, 2916, 3025, 3249, 3481, 3721, 4096, 4356, 4761, 5041, 5184, 5329, 5476, 6084, 6241
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1999

Keywords

Comments

Contains all members of A078255 that are < 10^10. 7744 is the first member that is not a member of A078255. - David Wasserman, Jun 27 2006

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,M;
      L:= convert(n,base,10);
      M:= {seq(numboccur(i,L),i=0..9)} minus {0};
      nops(M) = 1
    end proc:
    select(filter, [seq(i^2,i=0..200)]); # Robert Israel, Jan 08 2018
  • Mathematica
    t={}; Do[If[Length[DeleteDuplicates[Transpose[Tally[IntegerDigits[n^2]]][[2]]]] == 1, AppendTo[t,n^2]], {n,0,80}]; t (* Jayanta Basu, May 10 2013 *)
    sfQ[n_]:=Length[Union[Select[DigitCount[n],#!=0&]]]==1; Select[ Range[ 0,80]^2,sfQ] (* Harvey P. Dale, May 05 2019 *)

Extensions

Offset corrected by Michel Marcus, Aug 12 2015

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

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

A119509 Positive numbers whose square contains no digit more than once.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 16, 17, 18, 19, 23, 24, 25, 27, 28, 29, 31, 32, 33, 36, 37, 42, 43, 44, 48, 49, 51, 52, 53, 54, 55, 57, 59, 61, 64, 66, 69, 71, 72, 73, 74, 78, 79, 82, 84, 86, 87, 89, 93, 95, 96, 98, 99, 113, 116, 117, 118, 124, 126, 128, 133
Offset: 1

Views

Author

Tanya Khovanova, Jul 26 2006

Keywords

Comments

There are exactly 610 terms. a(610) = 99066 and 99066^2 = 9814072356. - Rick L. Shepherd, Jul 27 2006
If we count 0, there is one more term, for a total of 611. - T. D. Noe, Jun 21 2013

Crossrefs

Subsequence of A045540 = numbers whose squares contain an equal number of each digit that they contain. The first number that belongs to A045540 and doesn't belong to this sequence is number 88.

Programs

  • Magma
    [n: n in [1..10^5] | #Set(d) eq #d where d is Intseq(n^2)];  // Bruno Berselli, Aug 02 2011
    
  • Maple
    lim:=floor(sqrt(9876543210)): A119509:={}: for n from 1 to lim do pandig:=true: d:=convert(n^2,base,10): for k from 0 to 9 do if(numboccur(k, d)>1)then pandig:=false: break: fi: od: if(pandig)then A119509 := A119509 union {n}: fi: od: op(sort(convert(A119509,list))); # Nathaniel Johnston, Jun 23 2011
  • Mathematica
    Select[Range[1000000], Length[IntegerDigits[ # ^2]] == Length[Union[IntegerDigits[ # ^2]]] &] (* Tanya Khovanova, May 29 2007 *)
    Select[Range[10^5], Max[DigitCount[#^2]] <= 1 &] (* T. D. Noe, Aug 02 2011 *)
  • PARI
    is_A119509(n)=#(n=digits(n^2))==#Set(n) \\ M. F. Hasler, Sep 08 2017
    
  • Python
    def ok(n): s = str(n**2); return n > 0 and len(set(s)) == len(s)
    afull = [k for k in range(10**5) if ok(k)] # Michael S. Branicky, Nov 27 2022

Extensions

More terms from Rick L. Shepherd, Jul 27 2006

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)

A259187 Primes p such that both p and p^2 are distinct-digit numbers.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 43, 53, 59, 61, 71, 73, 79, 89, 137, 179, 193, 269, 281, 367, 397, 463, 487, 509, 571, 593, 647, 709, 829, 839, 1307, 1873, 2069, 2731, 2801, 3041, 4157, 4967, 4987, 6043, 7549, 7621, 8623, 21397
Offset: 1

Views

Author

Zak Seidov, Jun 20 2015

Keywords

Comments

Corresponding squares are 4, 9, 25, 49, 169, 289, 361, 529, 841, 961, 1369, 1849, 2809, 3481, 3721, 5041, 5329, 6241, 7921, 18769, 32041, 37249, 72361, 78961, 134689, 157609, 214369, 237169, 259081, 326041, 351649, 418609, 502681, 687241, 703921, 1708249, 3508129, 4280761, 7458361, 7845601, 9247681, 17280649, 24671089, 24870169, 36517849, 56987401, 58079641, 74356129, 457831609 (subsequence of A078255).

Crossrefs

Subsequence of A029743 and of A119509. Cf. A078255.

Programs

  • Mathematica
    Select[Prime[Range[2500]],Max[DigitCount[#]]<2&&Max[DigitCount[#^2]]<2&] (* Harvey P. Dale, May 25 2020 *)

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)

A366940 a(n) is the number of positive squares with n digits, all distinct.

Original entry on oeis.org

3, 6, 13, 36, 66, 96, 123, 97, 83, 87, 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

Tanya Khovanova, Oct 29 2023

Keywords

Comments

a(n) = 0, for n > 10.

Examples

			a(1)=3 because all three 1-digit squares, 1, 4, and 9, have trivially distinct digits.
a(2)=6 because all six 2-digit squares, 16, 25, 36, 49, 64, and 81, have distinct digits.
158407396 = 12586^2: has 9 distinct digits. Thus, this number contributes to a(9). On the other hand, 158382225 = 12585^2 has repeated digits. Thus, it doesn't contribute.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[100000], Length[Union[IntegerDigits[#^2]]] == k &&  Length[IntegerDigits[#^2]] == k &]], {k, 10}]
  • Python
    from math import isqrt
    from itertools import permutations
    def sqr(n): return isqrt(n)**2 == n
    def a(n):
        if n > 10: return 0
        return sum(1 for p in permutations("0123456789", n) if p[0] != '0' and sqr(int("".join(p))))
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Oct 29 2023

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