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.

A096497 Prime following n-th repunit.

Original entry on oeis.org

2, 13, 113, 1117, 11113, 111119, 1111151, 11111117, 111111113, 1111111121, 11111111113, 111111111149, 1111111111139, 11111111111123, 111111111111229, 1111111111111123, 11111111111111119, 111111111111111131, 1111111111111111171, 11111111111111111131, 111111111111111111157, 1111111111111111111189
Offset: 1

Views

Author

Labos Elemer, Jul 09 2004

Keywords

Comments

Not equal to A068693: first and 2nd terms differ.

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[(10^n-1)/9], {n, 40}]
    Table[NextPrime[FromDigits[PadRight[{},n,1]]],{n,30}] (* Harvey P. Dale, Aug 11 2023 *)
  • PARI
    a(n) = nextprime((10^n-1)/9 + 1); \\ Michel Marcus, May 02 2016
    
  • Python
    from sympy import nextprime
    def A096497(n):
        return nextprime((10**n-1)//9) # Chai Wah Wu, Nov 04 2019

Formula

a(n) = A002275(n) + A096869(n) = A096498(n) + A096499(n).

A096498 Prime before n-th repunit.

Original entry on oeis.org

7, 109, 1109, 11093, 111109, 1111091, 11111101, 111111109, 1111111097, 11111111059, 111111111103, 1111111111093, 11111111111053, 111111111111053, 1111111111111039, 11111111111111107, 111111111111111091, 1111111111111111037, 11111111111111111027, 111111111111111111053, 1111111111111111111097
Offset: 2

Views

Author

Labos Elemer, Jul 09 2004

Keywords

Crossrefs

Programs

  • Maple
    seq(prevprime((10^n-1)/9), n=2..50); # Robert Israel, Nov 13 2017
  • Mathematica
    Table[NextPrime[(10^n - 1)/9, -1], {n, 2, 22}] (* updated by Michael De Vlieger, May 02 2016 *)
  • PARI
    a(n) = precprime((10^n-1)/9 - 1); \\ Michel Marcus, May 02 2016

Formula

a(n) = A002275(n) - A096870(n) = A096497(n) - A096499(n).

A096499 Difference between prime following and prime preceding n-th repunit.

Original entry on oeis.org

6, 4, 8, 20, 10, 60, 16, 4, 24, 54, 46, 46, 70, 176, 84, 12, 40, 134, 104, 104, 92, 24, 84, 270, 300, 130, 414, 90, 88, 240, 148, 198, 12, 64, 12, 300, 66, 70, 80, 102, 420, 142, 630, 140, 600, 88, 176, 312, 80, 96, 460, 132, 420, 284, 144, 408, 312, 180, 44, 300
Offset: 2

Views

Author

Labos Elemer, Jul 09 2004

Keywords

Examples

			n=2: 2nd repunit=11, 13-7=6=a[2].
		

Crossrefs

Programs

  • Mathematica
    <Harvey P. Dale, Sep 06 2015 *)

Formula

a(n) = A096497(n) - A096498(n) = A096869(n) + A096870(n).

A384873 a(n) is the smallest n-digit zeroless prime.

Original entry on oeis.org

2, 11, 113, 1117, 11113, 111119, 1111151, 11111117, 111111113, 1111111121, 11111111113, 111111111149, 1111111111139, 11111111111123, 111111111111229, 1111111111111123, 11111111111111119, 111111111111111131, 1111111111111111111, 11111111111111111131
Offset: 1

Views

Author

Gonzalo Martínez, Jun 11 2025

Keywords

Comments

This sequence differs from A096497: besides differing in the repunit primes (A004022), it also excludes terms containing the digit 0, such as A096497(53).
Repunits primes (A004022) are in this sequence. In fact, a(A004023(k)) = A004022(k), for all k >= 1.
With the exception of a(1) = 2, the terms begin with strings of 1's. The first term to include all positive even digits is a(1756) = 111....126843.

Examples

			The list of 3-digit prime numbers starts with 101, 103, 107, 109, and 113. Among these, 113 is the first that does not contain the digit 0. So, a(3) = 113.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x;
    for x from (10^n-1)/9 by 2 do
      if isprime(x) and not member(0,convert(x,base,10)) then return x fi
    od
    end proc:
    f(1):= 2:
    map(f, [$1..20]); # Robert Israel, Jun 12 2025
  • Mathematica
    a[n_]:=Module[{k=PrimePi[10^n/9-1]},Until[DigitCount[Prime[k],10,0]==0,k++];Prime[k]] (* James C. McMahon, Jun 21 2025 *)
  • PARI
    a(n) = forprime(p=(10^n-1)/9, , if (vecmin(digits(p)), return(p))); \\ Michel Marcus, Jun 15 2025
  • Python
    from itertools import product
    from sympy import isprime
    def a(n):
        for t in product('123456789', repeat=n):
            p = int(''.join(t))
            if isprime(p): return p
    print([a(n) for n in range(1, 21)])
    
  • Python
    from sympy import nextprime
    def A384873(n):
        m = nextprime((10**n-1)//9-1)
        while '0' in str(m):
            m = nextprime(m)
        return m # Chai Wah Wu, Jun 20 2025
    

A068694 Largest n-digit prime with all odd digits.

Original entry on oeis.org

7, 97, 997, 9973, 99991, 999979, 9999991, 99999971, 999999937, 9999999557, 99999999977, 999999999959, 9999999999971, 99999999999973, 999999999999577, 9999999999999937, 99999999999999997, 999999999999999737
Offset: 1

Views

Author

Amarnath Murthy, Mar 03 2002

Keywords

Crossrefs

Formula

a(n)<=A003618(n). - R. J. Mathar, May 18 2007

Extensions

More terms from Sascha Kurz, Mar 17 2002
Showing 1-5 of 5 results.