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.

A006055 Primes with consecutive (ascending) digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 67, 89, 4567, 78901, 678901, 23456789, 45678901, 9012345678901, 789012345678901, 56789012345678901234567890123, 90123456789012345678901234567, 678901234567890123456789012345678901
Offset: 1

Views

Author

N. J. A. Sloane, Richard C. Schroeppel

Keywords

References

  • J. S. Madachy, Consecutive-digit primes - again, J. Rec. Math., 5 (No. 4, 1972), 253-254.
  • Thomas E. Moore, A Note on the Distribution of Primes in Arithmetic Progressions, J. Rec. Math., 5 (1972), 253-254.
  • R. C. Schroeppel, personal communication, 1991.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Zwillinger, Consecutive-Digit Primes - In Different Bases, J. Rec. Math., 10 (1972), 32-33.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{u = Range@n, t = Table[1, {n}]}, Select[ Drop[ Union@ Flatten@ Table[ FromDigits[ Mod[u + i*t, 10]], {i, 10}], 2], PrimeQ@# &]]; Array[f, 35] // Flatten (* Robert G. Wilson v, Jul 05 2006 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def bgen(): yield from (int("".join(str((s0+i)%10) for i in range(d))) for d in count(1) for s0 in range(1, 10))
    def agen(): yield from filter(isprime, bgen())
    print(list(islice(agen(), 18))) # Michael S. Branicky, May 26 2022

Extensions

a(17) from Robert G. Wilson v, Jul 05 2006
Entry revised by N. J. A. Sloane, Feb 07 2007

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} &]

A052017 Primes with digits in ascending order that differ exactly by 1.

Original entry on oeis.org

2, 3, 5, 7, 23, 67, 89, 4567, 23456789
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Comments

Primes in A138141. - Omar E. Pol, Dec 07 2008

Crossrefs

Cf. A138141. - Omar E. Pol, Dec 07 2008

A138142 Nonnegative numbers with digits in descending order that differ exactly by 1.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 32, 43, 54, 65, 76, 87, 98, 210, 321, 432, 543, 654, 765, 876, 987, 3210, 4321, 5432, 6543, 7654, 8765, 9876, 43210, 54321, 65432, 76543, 87654, 98765, 543210, 654321, 765432, 876543, 987654
Offset: 1

Views

Author

Omar E. Pol, Mar 19 2008

Keywords

Comments

This finite sequence has 55 members. The last member is 9876543210. There are 11-k members with k digits. See A052016 for primes in this sequence. All members with 3 or more digits are straight-line numbers A135643.

Examples

			Last 10 members of this finite sequence:
a(45)=6543210
a(46)=7654321
a(47)=8765432
a(48)=9876543
a(49)=76543210
a(50)=87654321
a(51)=98765432
a(52)=876543210
a(53)=987654321
a(54)=9876543210
		

Crossrefs

Programs

  • Mathematica
    fQ[n_]:=Module[{id=IntegerDigits[n]}, n<10 || Union[Differences[id]]=={-1}]; Select[Range[0, 100000], fQ] (* Vladimir Joseph Stephan Orlovsky, Dec 29 2010 *)
    Sort[Flatten[With[{t=Range[9,0,-1]},Table[FromDigits/@Partition[t,n,1],{n,10}]]]] (* Harvey P. Dale, Oct 31 2013 *)

Extensions

Examples corrected by Omar E. Pol, Dec 06 2008

A215478 Semiprimes with digits in descending order that differ exactly by 1.

Original entry on oeis.org

4, 6, 9, 10, 21, 65, 87, 321, 543, 4321, 8765, 98765, 654321, 876543, 7654321
Offset: 1

Views

Author

Jonathan Vos Post, Aug 12 2012

Keywords

Comments

This is to semiprimes A001358 as A052016 is to primes A000040.

Examples

			4321 is in the sequence because it is semiprime 4321 = 29 * 149, and (4,3,2,1) are descending consecutive digits.
		

Crossrefs

Programs

  • Mathematica
    Sort[Flatten[Table[Select[FromDigits/@Partition[Range[9,0,-1],n,1], PrimeOmega[#] == 2&],{n,10}]]] (* Harvey P. Dale, Jul 10 2014 *)

Extensions

Corrected and extended by R. J. Mathar, Aug 13 2012
Showing 1-5 of 5 results.