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-3 of 3 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).

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).

A096870 Difference between the n-th repunit and the previous prime.

Original entry on oeis.org

4, 2, 2, 18, 2, 20, 10, 2, 14, 52, 8, 18, 58, 58, 72, 4, 20, 74, 84, 58, 14, 18, 82, 168, 28, 50, 168, 84, 8, 138, 112, 82, 2, 28, 2, 62, 34, 50, 74, 24, 8, 54, 204, 22, 428, 40, 118, 200, 72, 40, 30, 42, 284, 44, 114, 268, 80, 18, 4, 74, 142, 182, 140, 112, 214, 152, 90
Offset: 2

Views

Author

Robert G. Wilson v, Jul 12 2004

Keywords

Crossrefs

Cf. A096869.

Programs

  • Maple
    f:= proc(n) local r; r:= (10^n-1)/9; r - prevprime(r) end proc:
    map(f, [$2..100]); # Robert Israel, Feb 23 2017
  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; Table[(10^n - 1)/9 - PrevPrim[(10^n - 1)/9], {n, 2, 70}]
    Table[With[{ru=(10^n-1)/9},ru-NextPrime[ru,-1]],{n,2,70}] (* Harvey P. Dale, Aug 14 2011 *)

Formula

a(n) = A002275(n) - A096498(n) = A096499(n) - A096869(n).
Showing 1-3 of 3 results.