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

A318725 a(n) is the smallest number k such that k! is pandigital in base n.

Original entry on oeis.org

2, 8, 5, 11, 17, 14, 15, 23, 23, 24, 36, 30, 35, 46, 50, 43, 50, 40, 59, 62, 54, 69, 75, 70, 65, 79, 83, 68, 97, 99, 86, 89, 93, 97, 118, 94, 106, 126, 128, 116, 145, 127, 134, 151, 143, 124, 141, 124, 141, 170, 194, 169, 190, 183, 181, 180, 195, 195, 210, 163
Offset: 2

Views

Author

Jon E. Schoenfield, Sep 02 2018

Keywords

Examples

			a(2) = 2! = 2_10 = 10_2;
a(3) = 8! = 40320_10 = 2001022100_3;
a(4) = 5! = 120_10 = 1320_4.
a(5) = 11! = 39916800_10 = 4020431420_5;
a(6) = 17! = 355687428096000_10 = 3300252314304000000_6.
		

Crossrefs

Cf. A049363 (smallest pandigital number in base n), A185122 (smallest pandigital prime in base n), A260182 (smallest square that is pandigital in base n), A260117 (smallest triangular number that is pandigital in base n).

Programs

  • PARI
    a(n) = {my(k=1); while (#Set(digits(k!, n)) != n, k++); k;} \\ Michel Marcus, Sep 02 2018
    
  • Python
    from itertools import count
    from sympy.ntheory import digits
    def A318725(n):
        c, flag = 1, False
        for k in count(1):
            m = k
            if flag:
                a, b = divmod(m,n)
                while not b:
                    m = a
                    a, b = divmod(m,n)
            c *= m
            if len(set(digits(c,n)[1:]))==n:
                return k
            if not (flag or c%n):
                flag = True # Chai Wah Wu, Mar 13 2024

A318779 Smallest n-th power that is pandigital in base n.

Original entry on oeis.org

4, 64, 625, 248832, 11390625, 170859375, 1406408618241, 3299763591802133, 3656158440062976, 550329031716248441, 766217865410400390625, 15791096563156692195651, 6193386212891813387462761, 243008175525757569678159896851, 3433683820292512484657849089281
Offset: 2

Views

Author

Jon E. Schoenfield, Sep 03 2018

Keywords

Comments

For the corresponding n-th roots a(n)^(1/n), see A318780.

Examples

			a(2)=4 because 1^2 = 1 = 1_2 (not pandigital in base 2, since it contains no 0 digit), but 2^2 = 4 = 100_2.
a(3)=64 because 1^3 = 1 = 1_3, 2^3 = 8 = 22_3, and 3^3 = 27 = 1000_3 are all nonpandigital in base 3, but 4^3 = 64 = 2101_3.
a(16) = 81^16 = 3433683820292512484657849089281 = 2b56d4af8f7932278c797ebd01_16.
		

Crossrefs

Cf. A049363 (smallest pandigital number in base n), A185122 (smallest pandigital prime in base n), A260182 (smallest square that is pandigital in base n), A260117 (smallest triangular number that is pandigital in base n), A318725 (smallest k such that k! is pandigital in base n), A318780 (smallest k such that k^n is pandigital in base n).

Programs

  • Python
    from itertools import count
    from sympy import integer_nthroot
    from sympy.ntheory import digits
    def A318779(n): return next(k for k in (k**n for k in count(integer_nthroot((n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1,n)[0])) if len(set(digits(k,n)[1:]))==n) # Chai Wah Wu, Mar 13 2024

Formula

a(n) = A318780(n)^n.

A318780 a(n) is the smallest positive integer k such that k^n is pandigital in base n.

Original entry on oeis.org

2, 4, 5, 12, 15, 15, 33, 53, 36, 41, 55, 51, 59, 91, 81, 60, 131, 167, 173, 312, 213, 394, 309, 222, 356, 868, 351, 704, 526, 1190, 1314, 847, 1435, 1148, 1755, 1499, 1797, 1455, 2311, 1863, 1838, 2120, 2859, 3219, 3463, 2833, 1723, 3009, 3497, 5886, 3746
Offset: 2

Views

Author

Jon E. Schoenfield, Sep 03 2018

Keywords

Comments

For the corresponding values of k^n, see A318779.

Examples

			a(2)=2 because 1^2 = 1 = 1_2 (not pandigital in base 2, since it contains no 0 digit), but 2^2 = 4 = 100_2.
a(3)=4 because 1^3 = 1 = 1_3, 2^3 = 8 = 22_3, and 3^3 = 27 = 1000_3 are all nonpandigital in base 3, but 4^3 = 64 = 2101_3.
a(16)=81: 81^16 = 3433683820292512484657849089281 = 2b56d4af8f7932278c797ebd01_16.
		

Crossrefs

Cf. A049363 (smallest pandigital number in base n), A185122 (smallest pandigital prime in base n), A260182 (smallest square that is pandigital in base n), A260117 (smallest triangular number that is pandigital in base n), A318725 (smallest k such that k! is pandigital in base n), A318779 (smallest n-th power that is pandigital in base n).

Programs

  • Python
    from itertools import count
    from sympy import integer_nthroot
    from sympy.ntheory import digits
    def A318780(n): return next(k for k in count(integer_nthroot((n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1,n)[0]) if len(set(digits(k**n,n)[1:]))==n) # Chai Wah Wu, Mar 13 2024

Formula

a(n) = A318779(n)^(1/n).

A339693 All pandigital squares which contain each digit exactly once in some base b >= 2. The numbers are written in base 10.

Original entry on oeis.org

225, 38025, 314721, 622521, 751689, 3111696, 6002500, 7568001, 10323369, 61058596, 73513476, 74545956, 94517284, 105144516, 112572100, 112656996, 132756484, 136936804, 181980100, 202948516, 210308004, 211353444, 219573124, 222069604, 230614596, 238208356, 251983876
Offset: 1

Views

Author

David Schilling, Dec 13 2020

Keywords

Comments

The sequence consists of all square numbers which when represented in some base b contain all the b digits in that base exactly once.
A225218 has all the squares in base 10 that are pandigital. This sequence is the union of all such sequences in any integer base b >= 2.

Examples

			15^2 in base 4 (225 is 3201 in base 4) contains the digits 0-3.
195^2 in base 6 (38025 is 452013 in base 6) contains the digits 0-5.
The next three terms contain all the digits in base 7.
The following four entries are pandigital in base 8, the next 26 in base 9, and so on.
		

Crossrefs

Programs

  • JAI
    #import "Basic";
    dstr := "0123456789abcdef";
    main :: () {
        digits : [16] int;
        for j:2..3_000_000 {
            for b:3..16 {
                for d : 0..15
                    digits[d] = 0;
                k := j*j;
                s := tprint( "%",  formatInt( k, b ) );
                if s.count > b
                    continue;
                for d : 0..s.count-1 {
                    for c : 0..dstr.count-1 {
                        if s[d] == dstr[c] {
                            digits[c] += 1;
                            continue d;
                        }
                    }
                }
                for d : 0..b-1 {
                    if digits[d] != 1
                        continue b;
                }
                print( "%, ", k );
            }
        }
    }
    
  • PARI
    \\ here ispandig(n) returns base if n is pandigital, otherwise 0.
    ispandig(n)={for(b=2, oo, my(r=logint(n,b)+1); if(rAndrew Howroyd, Dec 20 2020

A340501 Smallest square which when written in base b contains each digit exactly once, or -1 if no such square exists.

Original entry on oeis.org

-1, -1, 225, -1, 38025, 314721, 3111696, 61058596, 1026753849, 31529329225, 892067027049, -1, 803752551280900, 29501156485626049, 1163446635475467225, -1, 2200667320658951859841, 104753558229986901966129, 5272187100814113874556176, -1, 15588378150732414428650569369
Offset: 2

Views

Author

N. J. A. Sloane, Jan 13 2021

Keywords

Comments

Note that "pandigital" just means every digit appears at least once. The condition here is stronger. Maybe this should be called "Smallest strictly pandigital square in base b"?
Does this sequence contain infinitely many positive terms? Equally, is A339693 infinite?
It is shown in A258103 that a(n) = -1 for n = 2,3,5,13,17,21 and infinitely many other values.

Examples

			  base       a(base)  digits
   4             225 [3, 2, 0, 1]
   6           38025 [4, 5, 2, 0, 1, 3]
   7          314721 [2, 4, 5, 0, 3, 6, 1]
   8         3111696 [1, 3, 6, 7, 5, 4, 2, 0]
   9        61058596 [1, 3, 6, 8, 0, 2, 5, 7, 4]
  10      1026753849 [1, 0, 2, 6, 7, 5, 3, 8, 4, 9]
  11     31529329225 [1, 2, 4, 0, 10, 5, 3, 6, 7, 8, 9]
  12    892067027049 [1, 2, 4, 10, 7, 11, 5, 3, 8, 6, 0, 9]
  14 803752551280900 [1, 0, 2, 6, 9, 11, 8, 12, 5, 7, 13, 3, 10, 4]
		

Crossrefs

Inspired by A258103, A260182, A339693.

Programs

  • Python
    from sympy import integer_nthroot
    def digits(n, b):
      out = []
      while n >= b: n, r = divmod(n, b); out.append(r)
      return [n] + out[::-1]
    def a(n):
      b, b2b = n, n**n
      r, a = integer_nthroot(b**(b-1), 2); s = r**2
      while s < b**(b-1): s += 2*r + 1; r += 1
      while s < b2b:
        if len(set(digits(s, b))) == n: return s
        s += 2*r + 1; r += 1
      return -1
    print([a(n) for n in range(2, 13)]) # Michael S. Branicky, Jan 13 2021

Extensions

a(10)-a(22) from Hugo Pfoertner and Alois P. Heinz, Jan 13 2021
Showing 1-5 of 5 results.