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

A178984 a(n) is the smallest prime p that makes prime(n) + 1 - p a prime.

Original entry on oeis.org

3, 3, 5, 3, 5, 3, 5, 7, 3, 7, 5, 3, 5, 7, 7, 3, 7, 5, 3, 7, 5, 7, 19, 5, 3, 5, 3, 5, 19, 5, 7, 3, 11, 3, 7, 7, 5, 7, 7, 3, 11, 3, 5, 3, 13, 13, 5, 3, 5, 7, 3, 11, 7, 7, 7, 3, 7, 5, 3, 11, 31, 5, 3, 5, 19, 7, 11, 3, 5, 7, 19, 7, 7, 5, 7, 19, 5, 13, 11, 3, 11, 3
Offset: 3

Views

Author

Lei Zhou, Jan 06 2011

Keywords

Comments

If Goldbach's conjecture is true, this sequence is defined for all n.

Examples

			For n = 3, prime(3) = 5, and a(3) = 3 because 5 + 1 - 3 = 3 is prime;
For n = 4, prime(4) = 7, and a(4) = 3 because 7 + 1 - 3 = 5 is prime;
...
for n = 25, prime(n) = 97, and a(n) = 19 because 97 + 1 - 19 = 79 is prime.
		

Crossrefs

Differs from A119912 after 23 terms.

Programs

  • Mathematica
    f[n_] := Block[{i = 2, p = Prime[n + 2]},
      While[q = Prime[i]; ! PrimeQ[p + 1 - q], i++]; q]; Array[f, 60]
  • PARI
    a(n) = my(p=prime(n), q=2); while (!isprime(p+1-q), q = nextprime(q+1)); q; \\ Michel Marcus, Apr 01 2020

Extensions

More terms from Michel Marcus, Apr 01 2020
Showing 1-1 of 1 results.