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.

A048398 Primes with consecutive digits that differ exactly by 1.

Original entry on oeis.org

2, 3, 5, 7, 23, 43, 67, 89, 101, 787, 4567, 12101, 12323, 12343, 32321, 32323, 34543, 54323, 56543, 56767, 76543, 78787, 78989, 210101, 212123, 234323, 234343, 432121, 432323, 432343, 434323, 454543, 456767, 654323, 654343, 678767, 678989
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

Comments

Or, primes in A033075. - Zak Seidov, Feb 01 2011

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 67, p. 23, Ellipses, Paris 2008.

Crossrefs

Cf. A010051; intersection of A033075 and A000040.

Programs

  • Haskell
    a048398 n = a048398_list !! (n-1)
    a048398_list = filter ((== 1) . a010051') a033075_list
    -- Reinhard Zumkeller, Feb 21 2012, Nov 04 2010
    (Python 3.2 or higher)
    from itertools import product, accumulate
    from sympy import isprime
    A048398_list = [2,3,5,7]
    for l in range(1,17):
        for d in [1,3,7,9]:
            dlist = [d]*l
            for elist in product([-1,1],repeat=l):
                flist = [str(d+e) for d,e in zip(dlist,accumulate(elist)) if 0 <= d+e < 10]
                if len(flist) == l and flist[-1] != '0':
                    n = 10*int(''.join(flist[::-1]))+d
                    if isprime(n):
                        A048398_list.append(n)
    A048398_list = sorted(A048398_list) # Chai Wah Wu, May 31 2017
  • Mathematica
    Select[Prime[Range[10000]], # < 10 || Union[Abs[Differences[IntegerDigits[#]]]] == {1} &]