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.

A377842 a(n) = q - 2*p, where q is the greatest prime such that p=2*n - q is also prime.

Original entry on oeis.org

-2, -3, -1, 1, -3, 5, 7, 3, 11, 13, 9, 17, 13, 9, 23, 25, 21, 17, 31, 27, 35, 37, 33, 41, 37, 33, 47, 43, 39, 53, 55, 51, 47, 61, 57, 65, 67, 63, 59, 73, 69, 77, 73, 69, 83, 79, 75, 41, 91, 87, 95, 97, 93, 101, 103, 99, 107, 103, 99, 83, 91, 87, 71, 121, 117, 125, 121, 117, 131, 133
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Module[{p = 2, q},
      While[True, q = 2 n - p; If[PrimeQ[p] && PrimeQ[q], Break[]];
       p = NextPrime[p]]; q - 2 p], {n, 2, 100}]
  • PARI
    a(n) = my(q=precprime(2*n)); while (!isprime(2*n - q), q = precprime(q-1)); q - 2*(2*n-q); \\ Michel Marcus, Dec 12 2024