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.

A323026 Zeroless pandigital numbers that are between two twin primes.

Original entry on oeis.org

123457968, 123459768, 123946578, 124397658, 124936578, 124953678, 125347698, 125437968, 125463798, 125674398, 126345978, 126495738, 126593478, 126597348, 126945738, 127394568, 127396458, 127453968, 127459638, 127659438, 129357648, 129635478, 129673548, 132564978, 132594768, 132769458
Offset: 1

Views

Author

Pierandrea Formusa, Jan 02 2019

Keywords

Comments

Intersection of A050289 and A014574.
The definition permits repeated digits. - N. J. A. Sloane, May 16 2023
a(n) mod 10 is either 2 or 8. First term with a(n) mod 10 = 2 is a(27) = 134756982. - Chai Wah Wu, Jan 27 2019
There are 2595 terms that are pandigital without repeating any digit. - Harvey P. Dale, Jan 25 2021

Crossrefs

Cf. A050289 (zeroless pandigital numbers), A014574 (average of twin primes).

Programs

  • PARI
    isok(n) = my(d=digits(n)); vecmin(d) && (#Set(d)==9) && isprime(n-1) && isprime(n+1);
    for (n=123456789, 133000000, if (isok(n), print1(n, ", "))) \\ Michel Marcus, Jan 04 2019
    
  • Python
    import itertools
    from sympy import isprime
    nmax=pow(10,10)
    r=""
    li=[]
    def is_pandigit_easy(n):
        l=[]
        s=str(n)
        if '0' in s: return(False)
        for ch in s:
            if ch not in l: l.append(ch)
        l=list(set(l))
        if len(l)==9:
            return(True)
        else:
            return(False)
    t=0
    tmax=50
    for i in range(123456789,nmax):
        if is_pandigit_easy(i):
            if isprime(i-1) and isprime(i+1):
                li.append(i)
                t+=1
                if t>tmax: break
    first_elem=26
    for k in li[:first_elem]:
          r=r+","+str(k)
    print(r[1:])
    
  • Python
    from itertools import permutations
    from sympy import isprime
    A323026_list = [n for n in (int(''.join(s)) for s in permutations('123456789')) if isprime(n-1) and isprime(n+1)] # Chai Wah Wu, Jan 27 2019