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.

A185122 a(n) = minimum pandigital prime in base n.

Original entry on oeis.org

2, 11, 283, 3319, 48761, 863231, 17119607, 393474749, 10123457689, 290522736467, 8989787252711, 304978405943587, 11177758345241723, 442074237951168419, 18528729602926047181, 830471669159330267737, 39482554816041508293677, 1990006276023222816118943, 105148064265927977839670339, 5857193485931947477684595711
Offset: 2

Views

Author

Per H. Lundow, Jan 16 2012

Keywords

Comments

a(n) is the smallest prime whose base-n representation contains all digits (i.e., 0,1,...,n-1) at least once.

Examples

			The corresponding base-b representations are:
2  10
3  102
4  10123
5  101234
6  1013425
7  10223465
8  101234567
9  1012346785
10 10123457689
11 1022345689a7
12 101234568a79b
13 10123456789abc
14 10123456789cdab
15 10223456789adbce
...
		

Programs

  • Python
    from math import gcd
    from itertools import count
    from sympy import nextprime
    from sympy.ntheory import digits
    def A185122(n):
        m = n
        j = 0
        if n > 3:
            for j in range(1,n):
                if gcd((n*(n-1)>>1)+j,n-1) == 1:
                     break
        if j == 0:
            for i in range(2,n):
                m = n*m+i
        elif j == 1:
            for i in range(1,n):
                m = n*m+i
        else:
            for i in range(2,1+j):
                m = n*m+i
            for i in range(j,n):
                m = n*m+i
        m -= 1
        while True:
            if len(set(digits(m:=nextprime(m),n)[1:]))==n:
                return m # Chai Wah Wu, Mar 12 2024