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-4 of 4 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

A120805 Primes with consecutive digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 43, 67, 89, 109, 4567, 10987, 76543, 78901, 678901, 23456789, 45678901, 9012345678901, 789012345678901, 56789012345678901234567890123, 90123456789012345678901234567, 10987654321098765432109876543210987
Offset: 1

Views

Author

Robert G. Wilson v, Jul 05 2006

Keywords

Comments

Digits can be in ascending or descending order. After 9 comes 0 or after 0 comes 1.
The number of primes with n consecutive digits: 4,4,1,1,3,1,0,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,...,.

Crossrefs

Cf. A000040, A118697; union of A006055 & A120804.

Programs

  • Mathematica
    f[n_] := Block[{u = Range@n, d = Reverse@ Range@n, t = Table[1, {n}]}, Select[ Drop[ Union@ Flatten@ Table[ FromDigits /@ Mod[{u, d} + {i*t, i*t}, 10], {i, 10}], 2], PrimeQ@# &]]; Array[f, 35] // Flatten

A120828 Numbers k such that the concatenation of n successive descending digits (1,0,9,8,7,...) starting with 1 is prime.

Original entry on oeis.org

3, 5, 35, 139, 153, 253, 1053, 2015, 3703, 6933, 8173, 11959
Offset: 1

Views

Author

Robert G. Wilson v, Jul 05 2006

Keywords

Comments

Digits are in descending order beginning with 1 and after 0 comes 9.
Terms must end in 3, 5 or 9. - Michael S. Branicky, May 11 2023
a(13) > 10^5. - Michael S. Branicky, Apr 18 2025

Examples

			5 is a term since 10987 is a prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local i; isprime( add(10^(n-1-i)*(1-i mod 10), i=0..n-1)) end proc:
    select(filter, [$1..4000]); # Robert Israel, Mar 08 2023
  • Mathematica
    fQ[n_] := PrimeQ@ FromDigits@ Mod[2-Range@n, 10]; lst = {}; Do[ If[fQ@n, AppendTo[lst, n]; Print@n], {n, 6000}]; lst

Extensions

Name corrected by Robert Israel, Mar 08 2023
a(10)-a(12) from Michael S. Branicky, May 11 2023

A120829 a(n) consecutive digits descending beginning with the digit 4 give a prime.

Original entry on oeis.org

2, 64, 176, 1502, 4676, 7518, 8244, 8318
Offset: 1

Views

Author

Robert G. Wilson v, Jul 05 2006

Keywords

Comments

Digits are in descending order beginning with 4 and after 0 comes 9.
a(9) > 10^5. - Michael S. Branicky, Apr 22 2025

Examples

			2 is a term since 43 is a prime.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := PrimeQ@ FromDigits@ Mod[5-Range@n, 10]; lst = {}; Do[ If[fQ@n, AppendTo[lst, n]; Print@n], {n, 10000}]; lst

Extensions

a(6)-a(7) corrected and a(8) from Michael S. Branicky, Apr 08 2025
Showing 1-4 of 4 results.