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

A071363 Largest n-digit prime with strictly increasing digits.

Original entry on oeis.org

7, 89, 569, 5689, 34679, 345689, 1456789, 23456789
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Comments

Notice the terms with consecutive digits; search for 23456789 to find several related sequences including A006055, A052017 and A052077.

Examples

			a(1) = A052015(4), a(2) = A052015(15), a(3) = A052015(35), a(4) = A052015(61), ... In short, a(n) = A052015(b(n)) with b = (4, 15, 35, 61, 81, 94, 98, 100). - _M. F. Hasler_, May 03 2017
		

Crossrefs

Subsequence of A052015.

Programs

  • PARI
    A071363(n,u=vectorv(n,i,10^(n-i)))={forvec(d=vector(n,i,[1,9]),isprime(d*u)&&n=d*u,2);n} \\ M. F. Hasler, May 03 2017

A138141 Numbers with digits in ascending order that differ exactly by 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 23, 34, 45, 56, 67, 78, 89, 123, 234, 345, 456, 567, 678, 789, 1234, 2345, 3456, 4567, 5678, 6789, 12345, 23456, 34567, 45678, 56789, 123456, 234567, 345678, 456789, 1234567, 2345678, 3456789, 12345678, 23456789, 123456789
Offset: 1

Views

Author

Omar E. Pol, Mar 19 2008

Keywords

Comments

This finite sequence has 45 members. The last member is 123456789. There are 10-k members with k digits. See A052017 for primes in this sequence. All members with 3 or more digits are straight-line numbers A135643.

Crossrefs

Programs

  • Mathematica
    Table[FromDigits/@Partition[Range[9],n,1],{n,9}]//Flatten (* Harvey P. Dale, Mar 19 2017 *)

Formula

a(n) = floor(((9*t^2 - 189*t + 18*n + 182) * (10^t - 1) - 18*t) / 162), where t = floor((21 - sqrt(369 - 8*n)) / 2). - Christopher J. Thomas, Feb 14 2024

A052016 Primes with digits in descending order that differ exactly by 1.

Original entry on oeis.org

2, 3, 5, 7, 43, 76543
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    fQ[n_]:=Module[{id=IntegerDigits[n],}, n < 10 || Union[Differences[id]] == {-1}]; Select[Prime[Range[10000]], fQ] (* Vladimir Joseph Stephan Orlovsky, Dec 29 2010 *)

A058024 a(n) = A051451(n) - A058023(n).

Original entry on oeis.org

3, 5, 7, 11, 11, 17, 19, 23, 17, 43, 59, 37, 29, 41, 53, 43, 37, 43, 47, 83, 71, 83, 61, 149, 73, 97, 89, 109, 113, 103, 113, 89, 137, 167, 157, 181, 239, 139, 241, 139, 179, 233, 193, 163, 241, 173, 283, 167, 271, 193, 277, 181, 179, 199, 269, 193, 223, 239
Offset: 3

Views

Author

Labos Elemer, Nov 15 2000

Keywords

Examples

			So far, all terms are primes. The analogy with fortunate numbers (A005235) is clear.
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, Aug 20 2021
Name corrected by Sean A. Irvine, Jul 18 2022
Showing 1-6 of 6 results.