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-2 of 2 results.

A066285 a(n) is the minimal difference between primes p and q whose sum is 2n.

Original entry on oeis.org

0, 0, 2, 0, 2, 0, 6, 4, 6, 0, 2, 0, 6, 4, 6, 0, 2, 0, 6, 4, 18, 0, 10, 12, 6, 8, 18, 0, 2, 0, 18, 8, 6, 12, 10, 0, 18, 4, 6, 0, 2, 0, 6, 4, 30, 0, 10, 24, 6, 16, 18, 0, 14, 24, 6, 8, 30, 0, 2, 0, 18, 8, 6, 12, 10, 0, 30, 4, 6, 0, 2, 0, 30, 8, 6, 12, 10, 0, 18, 4, 30, 0, 10, 24, 6, 28, 18, 0
Offset: 2

Views

Author

Dean Hickerson, Dec 12 2001

Keywords

Comments

Terms are always even numbers because primes present in Goldbach partitions of n > 4 are odd and n = 4 has just one partition (2+2) where the difference is 0. a(n) = 0 iff n is prime. - Marcin Barylski, Apr 28 2018

Crossrefs

Programs

  • Mathematica
    a[n_] := For[p=n, True, p--, If[PrimeQ[p]&&PrimeQ[2n-p], Return[2n-2p]]]
  • PARI
    a(n) = {forstep(k=n, 1, -1, if (isprime(k) && isprime(2*n-k), return(2*n-2*k)););} \\ Michel Marcus, Jun 01 2020

Formula

a(n) = 2 * A047160(n). - Alois P. Heinz, Jun 01 2020

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.
Showing 1-2 of 2 results.