login
A308022
a(n) = prevprime(2*n-1) - nextprime(n-1), where prevprime = A151799 and nextprime = A151800.
0
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,4
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.
FORMULA
a(n) = A151799(2*n-1) - A151800(n-1).
EXAMPLE
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.
MATHEMATICA
Table[NextPrime[2 n - 1, -1] - NextPrime[n - 1, 1], {n, 2, 100}]
CROSSREFS
Sequence in context: A271230 A112824 A195133 * A001100 A218831 A242595
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, May 09 2019
STATUS
approved