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 12 results. Next

A036744 Penholodigital squares: squares containing each of the digits 1..9 exactly once.

Original entry on oeis.org

139854276, 152843769, 157326849, 215384976, 245893761, 254817369, 326597184, 361874529, 375468129, 382945761, 385297641, 412739856, 523814769, 529874361, 537219684, 549386721, 587432169, 589324176, 597362481, 615387249, 627953481, 653927184, 672935481, 697435281, 714653289, 735982641, 743816529, 842973156, 847159236, 923187456
Offset: 1

Views

Author

Keywords

Comments

Improved Mathematica formula provided. Because the range involved is only from Ceiling[Sqrt[123456789]]=11112 and Floor[Sqrt[987654321]]=31427, it only requires analyzing 20,315 numbers, versus 362,880 permutations of nine digits (as in the current formula). - Harvey P. Dale, Apr 17 2002
Since the sum of the digits is 45, the squares are all divisible by 3, so the given Mathematica formula could be sped up by a factor of 3, checking only multiples of 3 rather than all squares. - Joshua Zucker, Nov 28 2005
Eight-digit analog gives 5 squares: 13527684, 34857216, 65318724, 73256481, 81432576. - Zak Seidov, Mar 01 2011

Crossrefs

Programs

  • Maple
    lim:=floor(sqrt(987654321)): for n from 11112 by 3 to lim do d:=[op(convert(n^2, base, 10))]: pandig:=true: for k from 1 to 9 do if(numboccur(k, d)<>1)then pandig:=false: break: fi: od: if(pandig)then printf("%d, ", n^2): fi: od: # Nathaniel Johnston, Jun 22 2011
  • Mathematica
    Select[Range[11112, 31427]^2, Union[Drop[DigitCount[ # ], -1]] == {1} &]
  • PARI
    A036744 = [n^2 | n <- A071519] \\ or less efficient & more explicit:
    A036744 = [n^2 | n <- [1e5\9..1e5\3], vecsort(digits(n^2)) == [1..9]] \\ M. F. Hasler, Jun 28 2023

Formula

a(n) = A071519(n)^2.

Extensions

More terms from Harvey P. Dale, Sep 26 2001
Keyword base added by Reinhard Zumkeller, May 16 2010

A258103 Number of pandigital squares (containing each digit exactly once) in base n.

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 4, 26, 87, 47, 87, 0, 547, 1303, 3402, 0, 24192, 187562
Offset: 2

Views

Author

Adam J.T. Partridge, May 20 2015

Keywords

Comments

For n = 18, the smallest and largest pandigital squares are 2200667320658951859841 and 39207739576969100808801. For n = 19, they are 104753558229986901966129 and 1972312183619434816475625. For n = 20, they are 5272187100814113874556176 and 104566626183621314286288961. - Chai Wah Wu, May 20 2015
When n is even, (n-1) is a factor of the pandigital squares. When n is odd, (n-1)/2 is a factor with the remaining factors being odd. Therefore, when n is odd and (n-1)/2 has an odd number of 2s as prime factors there are no pandigital squares in base n (e.g. 5, 13, 17 and 21). - Adam J.T. Partridge, May 21 2015
If n is odd and (n-1)/2 has an odd 2-adic valuation, then there are no squares in base n using all the digits from 1 to n-1 once, or all the digits from 0 to n-2 once or all the digits from 1 to n-2 once. This can be proved using the same argument as in the linked blogposts. - Chai Wah Wu, Feb 25 2024

Examples

			For n=4 there is one pandigital square, 3201_4 = 225 = 15^2.
For n=6 there is one pandigital square, 452013_6 = 38025 = 195^2.
For n=10 there are 87 pandigital squares (A036745).
There are no pandigital squares in bases 2, 3, 5 or 13.
Hexadecimal has 3402 pandigital squares, the largest is FED5B39A42706C81.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n%2==1 && valuation(n-1,2)%2==0, 0, my(lim=sqrtint(n^n - (n^n-n)/(n-1)^2), count=0); for(m=sqrtint((n^n-n)/(n-1)^2 + n^(n-2)*(n-1) - 1), lim, if(#Set(digits(m^2,n))==n, count++)); count) \\ Jianing Song, Feb 23 2024. Note that the searching range for m is [sqrt(A049363(n)), sqrt(A062813(n))]
  • Python
    from gmpy2 import isqrt, mpz, digits
    def A258103(n): # requires 2 <= n <= 62
        c, sm, sq = 0, mpz(''.join([digits(i, n) for i in range(n-1, -1, -1)]), n), mpz(''.join(['1', '0']+[digits(i, n) for i in range(2, n)]), n)
        m = isqrt(sq)
        sq = m*m
        m = 2*m+1
        while sq <= sm:
            if len(set(digits(sq, n))) == n:
                c += 1
            sq += m
            m += 2
        return c # Chai Wah Wu, May 20 2015
    

Extensions

a(17)-a(19) from Giovanni Resta, May 20 2015

A363905 Numbers whose square and cube taken together contain each decimal digit.

Original entry on oeis.org

69, 128, 203, 302, 327, 366, 398, 467, 542, 591, 593, 598, 633, 643, 669, 690, 747, 759, 903, 923, 943, 1016, 1018, 1027, 1028, 1043, 1086, 1112, 1182, 1194, 1199, 1233, 1278, 1280, 1282, 1328, 1336, 1364, 1396, 1419, 1459, 1463, 1467, 1472, 1475
Offset: 1

Views

Author

M. F. Hasler, Jun 27 2023

Keywords

Comments

The first term, a(1) = 69, is the only number for which the square and the cube together contain each decimal digit 0 to 9 exactly once.
a(820) = 6534 is the only number of which the square and cube taken together contain each digit 0 to 9 exactly twice.

Examples

			69^2 = 4761, 69^3 = 328509, which together contain each digit 0-9 exactly once.
		

Crossrefs

Cf. A036744, A054038, A071519 and A156977 for "pandigital" squares.
Cf. A119735: Numbers n such that every digit occurs at least once in n^3.

Programs

  • Mathematica
    fQ[n_] := Union[ Join[ IntegerDigits[n^2], IntegerDigits[n^3]]] == {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; Select[Range@1500, fQ] (* Robert G. Wilson v, Jun 27 2023 *)
  • PARI
    is(k)=#setunion(Set(digits(k^2)),Set(digits(k^3)))>9
    select(is,[1..9999])
    
  • Python
    from itertools import count, islice
    def A363905_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:len(set(str(n**2))|set(str(n**3)))==10,count(max(startvalue,1)))
    A363905_list = list(islice(A363905_gen(),20)) # Chai Wah Wu, Jun 27 2023

A294661 Numbers whose square contains all of the digits 1 through 9.

Original entry on oeis.org

11826, 12363, 12543, 14676, 15681, 15963, 18072, 19023, 19377, 19569, 19629, 20316, 22887, 23019, 23178, 23439, 24237, 24276, 24441, 24807, 25059, 25572, 25941, 26409, 26733, 27129, 27273, 29034, 29106, 30384, 32043, 32286, 33144, 34273, 35172, 35337, 35713, 35756, 35757, 35772, 35846, 35853
Offset: 1

Views

Author

M. F. Hasler, Nov 08 2017

Keywords

Comments

The sequence has asymptotic density 1: it contains "almost all" numbers.

Examples

			11826^2 = 139854276 contains all digits from 1 to 9 exactly once.
The same is true for all terms up to 30384 whose square is 923187456. These terms are also listed in A071519, they form a subsequence of A054037.
The next 3 terms, 32043 (32043^2 = 1026753849), 32286 (32286^2 = 1042385796) and 33144 (33144^2 = 1098524736) contain all of the digits '0' through '9' exactly once: They are the first terms of A054038.
The next term, 34273 with 34273^2 = 1174638529, does not have this property, but the next two are again of that type (35172^2 = 1237069584 and 35337^2 = 1248703569).
		

Crossrefs

Cf. A054037, A071519 (finite subsequence of the first 30 terms), A054038.

Programs

  • Mathematica
    Select[Range[#, # + 3*10^4] &@ 11111, AllTrue[Most@ DigitCount[#^2], # > 0 &] &] (* Michael De Vlieger, Nov 08 2017 *)
  • PARI
    is_A294661(n)=#select(t->t,Set(digits(n^2)))>8
    N=100;for(k=10^4,oo,is_A294661(k)||next;print1(k",");N--||break)

A363927 Numbers N such that in the concatenation of N^2 and N^3, each of the 10 decimal digits appears equally often.

Original entry on oeis.org

69, 6534, 497375, 539019, 543447, 586476, 589629, 601575, 646479, 858609, 895688, 959097, 46839081, 47469378, 47693199, 47760623, 47841576, 48038964, 48527792, 48733506, 48886836, 48965892, 49229103, 49397283, 49594832, 49670616, 50013116, 50247423, 50359157
Offset: 1

Views

Author

Keywords

Comments

a(3) = 497375 and a(11) = 895688 are the only terms < 10^6 that are not divisible by 3.
Each term has an even number of decimal digits, k, and a corresponding value between 10^(k-1)*100^(1/3) and 10^k. - Michael S. Branicky, Jun 29 2023
Indeed, the number of digits of concat(N^2, N^3) is floor(2*L + 1) + floor(3*L + 1) where L = log_10(N). This is a multiple of 10 iff L mod 2 is in the interval [5/3, 2), which means that N is in the above range for some even k. - M. F. Hasler, Jul 02 2023

Crossrefs

Cf. A363905, A363909: concat(n^2, n^3) has each digit at least once / twice.
Cf. A171102: pandigital numbers.
Cf. A036744, A054038, A071519 and A156977 for "pandigital squares".
Cf. A119735: n^3 is pandigital.

Programs

  • Mathematica
    fQ[n_] := Length@ Union[ Count[ Sort[ Join[ IntegerDigits[n^2], IntegerDigits[n^3]]], #] & /@ Range[0, 9]] == 1; Select[ Range@ 52000000, fQ] (* Robert G. Wilson v, Jul 01 2023 *)
  • PARI
    is(n)={my(v=concat(digits(n^2),digits(n^3)), c=#v); c%10==0 && vecsort(v)==[0..c-1]\(c\10)}
    for(n=1,1e6, is(n)&& print1(n","))

Extensions

a(13) and beyond from Michael S. Branicky, Jun 28 2023

A261213 Odd numbers n such that n^2 = m + (m+1), where both m and m+1 have no repeated digits.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 23, 27, 29, 31, 35, 37, 39, 41, 43, 57, 63, 69, 77, 81, 87, 89, 95, 109, 113, 121, 125, 127, 129, 137, 163, 193, 219, 239, 271, 273, 279, 281, 285, 305, 311, 315, 331, 339, 353, 357, 377, 381, 395, 403, 409, 435, 441, 443, 597
Offset: 1

Views

Author

Pieter Post, Aug 12 2015

Keywords

Comments

This sequence is finite and a(146) = 40797 is the last term. 40797^2 = 1664395209 and 1664395209 = 832197604 + 832197605. These last two numbers both have no repeating digits.

Examples

			5 is in the sequence, because 5^2 = 25. 25 = 12 + 13. 12 and 13 both have no repeating digits.
		

Crossrefs

Programs

  • Mathematica
    nr[n_] := 1 == Max@ DigitCount@ n; Select[ Range[1, 10^5, 2], nr[x= Floor[#^2 / 2]] && nr[x + 1] &] (* Giovanni Resta, Aug 12 2015 *)

A345875 Numbers whose fourth powers are zeroless pandigital.

Original entry on oeis.org

608, 809, 897, 924, 1166, 1241, 1458, 1459, 1506, 1547, 1718, 1729, 1832, 1932, 1977, 1982, 2112, 2162, 2179, 2188, 2211, 2279, 2283, 2291, 2296, 2336, 2337, 2408, 2427, 2541, 2592, 2594, 2613, 2634, 2684, 2689, 2704, 2764, 2776, 2779, 2854, 2941, 2984, 2988, 3009
Offset: 1

Views

Author

Tanya Khovanova, Jun 27 2021

Keywords

Comments

Zeroless pandigital means that it contains all the digits 1 through 9, but doesn't contain a zero.

Examples

			608^4 = 136651472896. Thus, 608 belongs to this sequence.
		

Crossrefs

Cf. A071519 (for squares), A124628 (for cubes).
Subsequence of A121321 (4th power is pandigital).

Programs

  • Maple
    q:= n-> is({convert(n^4, base, 10)[]}={$1..9}):
    select(q, [$1..3000])[];  # Alois P. Heinz, Jun 29 2021
  • Mathematica
    Select[Range[8000], Union[IntegerDigits[#^4]] == {1, 2, 3, 4, 5, 6, 7, 8, 9} &]
  • PARI
    isok(k) = my(d=digits(k^4)); vecmin(d) && (#Set(d) == 9); \\ Michel Marcus, Jun 30 2021
  • Python
    def ok(n): return set(str(n**4)) == set("123456789")
    print(list(filter(ok, range(3000)))) # Michael S. Branicky, Jun 27 2021
    

A363909 Numbers whose square and cube taken together contain each decimal digit at least twice.

Original entry on oeis.org

6534, 11027, 11994, 21906, 22178, 22195, 23317, 24567, 27019, 27963, 28354, 29099, 29309, 29339, 29375, 29558, 29621, 30184, 30552, 30584, 31578, 31727, 32447, 32633, 32793, 32912, 32923, 33087, 33257, 33527, 34284, 35717, 36943, 36958, 37697, 38463
Offset: 1

Views

Author

M. F. Hasler, Jun 27 2023

Keywords

Comments

The first term, a(1) = 6534 is the only number of which the square and cube taken together contain each digit 0 to 9 exactly twice.
Presumably a(n) ~ A363905(n) ~ n. - Charles R Greathouse IV, Jul 03 2023

Examples

			6534^2 = 42693156, 6534^3 = 278957081304, which together contain each digit 0-9 exactly twice.
		

Crossrefs

Cf. A363905: square and cube together contain each digit at least once.
Cf. A036744, A054038, A071519 and A156977 for "pandigital" squares.
Cf. A119735: Numbers n such that every digit occurs at least once in n^3.

Programs

  • PARI
    is(n)=#Set(n=concat(digits(n^2),digits(n^3)))>9&&(n=vecsort(n))[#n-1]==9&&!n[2]&&!for(i=3,#n-2,n[i]>n[i-1]&&n[i]
    				

A370950 Number of penholodigital squares (containing each nonzero digit exactly once) in base n.

Original entry on oeis.org

1, 0, 0, 0, 2, 1, 1, 10, 30, 20, 23, 0, 160, 419, 740, 0, 5116, 47677
Offset: 2

Views

Author

Chai Wah Wu, Mar 06 2024

Keywords

Comments

From Chai Wah Wu, Mar 10 2024: (Start)
Theorem: Let m^2 be a pandigital square (containing each digit exactly once) or a penholodigital square (containing each nonzero digit exactly once) in base n. If n-1 is an odd squarefree number (A056911), then m is divisible by n-1. If n-1 is an even squarefree number (A039956), then m-(n-1)/2 is divisible by n-1.
Proof: Since n^k == 1 (mod n-1), and the sum of digits of m^2 is n*(n-1)/2, this implies that m^2 == n*(n-1)/2 (mod n-1). If n-1 is odd and squarefree, then n is even and m^2 == 0 (mod n-1). Since n-1 = Product_i p_i for distinct odd primes p_i, and m^2 == 0 (mod p_i) if and only if m == 0 (mod p_i), this implies that m == 0 (mod n-1) by the Chinese Remainder Theorem.
Similarly, if n-1 is even and squarefree, then m^2 == n(n-1)/2 == (n-1)/2 (mod n-1) and (n-1)/2 = Product_i p_i for distinct odd primes p_i, i.e., m^2 == 0 (mod p_i) and m^2 == 1 (mod 2). This implies that m == 0 (mod p_i) and m == 1 (mod 2). Again by the Chinese Remainder Theorem, m == (n-1)/2 (mod n-1).
(End)

Examples

			For n=2 there is one penholodigital square, 1_2 = 1 = 1^2.
For n=6 there are two penholodigital squares, 15324_6 = 2500 = 50^2 and 53241_6 = 7225 = 85^2.
For n=7 there is one penholodigital square, 623514_7 = 106929 = 327^2.
For n=8 there is one penholodigital square, 6532471_8 = 1750329 = 1323^2.
For n=10 there are 30 penholodigital squares listed in A036744.
		

Crossrefs

Programs

  • Python
    from gmpy2 import mpz, digits, isqrt
    def A370950(n): # requires 2 <= n <= 62
        if n&1 and (~(m:=n-1>>1) & m-1).bit_length()&1:
            return 0
        t = ''.join(digits(d,n) for d in range(1,n))
        k = mpz(''.join(digits(d,n) for d in range(n-1,0,-1)),n)
        k2 = mpz(t,n)
        c = 0
        for i in range(isqrt(k2),isqrt(k)+1):
            if i%n:
                j = i**2
                s = ''.join(sorted(digits(j,n)))
                if s == t:
                    c += 1
        return c

Formula

If n is odd and n-1 has an even 2-adic valuation, then a(n) = 0 (see A258103).

Extensions

a(18) from Chai Wah Wu, Mar 07 2024
a(19) from Chai Wah Wu, Mar 15 2025

A162859 Numbers n such that 9n^2 is a zeroless pandigital number.

Original entry on oeis.org

3942, 4121, 4181, 4892, 5227, 5321, 6024, 6341, 6459, 6523, 6543, 6772, 7629, 7673, 7726, 7813, 8079, 8092, 8147, 8269, 8353, 8524, 8647, 8803, 8911, 9043, 9091, 9678, 9702, 10128
Offset: 1

Views

Author

Zak Seidov, Jul 14 2009

Keywords

Crossrefs

Cf. A071519 Numbers whose square is a zeroless pandigital number.

Programs

  • Mathematica
    With[{c=Range[9]},Select[Range[11000],Sort[IntegerDigits[9 #^2]]== c&]] (* Harvey P. Dale, Jun 26 2011 *)

Formula

A071519(n)/3.

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010
Showing 1-10 of 12 results. Next