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.

A308022 a(n) = prevprime(2*n-1) - nextprime(n-1), where prevprime = A151799 and nextprime = A151800.

Original entry on oeis.org

0, 0, 0, 2, 0, 4, 2, 2, 6, 8, 6, 10, 6, 6, 12, 14, 12, 12, 14, 14, 18, 20, 14, 18, 18, 18, 24, 24, 22, 28, 24, 24, 24, 30, 30, 34, 32, 32, 32, 38, 36, 40, 36, 36, 42, 42, 36, 36, 44, 44, 48, 50, 44, 48, 50, 50, 54, 54, 52, 52, 46, 46, 46, 60, 60, 64, 60, 60
Offset: 2

Views

Author

Wesley Ivan Hurt, May 09 2019

Keywords

Comments

a(n) is the difference of the largest and smallest prime(s) in the closed interval [n, 2n-2].
Also, the maximum distance between all pairs of primes (not necessarily distinct) appearing among the largest parts of the partitions of 2n into two parts < 2n-1.

Examples

			a(10) = 6; The primes in the closed interval [10, 18] are 11, 13 and 17. The difference of the largest and smallest primes is 17 - 11 = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[2 n - 1, -1] - NextPrime[n - 1, 1], {n, 2, 100}]

Formula

a(n) = A151799(2*n-1) - A151800(n-1).