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.

A308044 a(n) = 2*prevprime(2*n-1) - 2*n, where prevprime(n) is the largest prime < n.

Original entry on oeis.org

0, 0, 2, 4, 2, 8, 10, 8, 14, 16, 14, 20, 18, 16, 26, 28, 26, 24, 34, 32, 38, 40, 38, 44, 42, 40, 50, 48, 46, 56, 58, 56, 54, 64, 62, 68, 70, 68, 66, 76, 74, 80, 78, 76, 86, 84, 82, 80, 94, 92, 98, 100, 98, 104, 106, 104, 110, 108, 106, 104, 102, 100, 98, 124
Offset: 2

Views

Author

Wesley Ivan Hurt, May 10 2019

Keywords

Comments

a(n) is the difference between the parts in the single partition of 2*n into two parts such that the larger part is the biggest prime < 2*n - 1.
For n > 1, the sequence of terms agrees with A303603 up to a(48), but a(49) = 80, whereas A303603(49) = 60. (This is because the smallest prime less than 2*49 - 1 = 97 is 89, which is paired with 9. This is the first instance in which the largest prime < 2*n - 1 is not paired with a prime. Regardless of whether the smallest part is prime or composite, we take the difference. So a(49) = 89 - 9 = 80.)

Crossrefs

Programs

  • Mathematica
    Table[2 NextPrime[2 n - 1, -1] - 2 n, {n, 2, 100}]
  • PARI
    a(n) = 2*precprime(2*n-2) - 2*n; \\ Michel Marcus, May 10 2019

Formula

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