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.

A284950 Number of primes p <= n such that 2*n-p and 2*n+p are prime.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 0, 3, 0, 1, 3, 0, 1, 3, 1, 0, 3, 1, 0, 3, 1, 0, 5, 0, 1, 4, 0, 1, 3, 0, 1, 4, 0, 0, 4, 1, 0, 6, 0, 0, 4, 0, 1, 2, 1, 1, 4, 1, 0, 4, 0, 0, 9, 0, 0, 5, 0, 0, 5, 1, 0, 4, 0, 0, 5, 0, 0, 6, 0, 1, 5, 0, 1, 5, 0, 0, 7, 1, 0, 5, 1, 0, 7, 0, 0, 6, 0, 0, 4, 1, 1, 4, 0
Offset: 1

Views

Author

Neil Fernandez, Apr 06 2017

Keywords

Comments

If n is not divisible by 3, a(n)<=1, as the only possible p is 3. - Robert Israel, Jul 20 2020

Examples

			a(5) is 1, because of all the pairs of primes p1 <= p2 which sum to 5*2=10, namely {3,7} and {5,5}, only (3,7) has p1+10 prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p1,p2,t;
      t:= 0: p1:= 2:
      do
        p1:= nextprime(p1);
        if p1 > n then return t fi;
        if isprime(p1+2*n) and isprime(2*n-p1)  then
          t:= t+1
        fi
      od
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 20 2020
  • Mathematica
    For[i = 1, i < 1001, i++,
    ee = 2*i;
    a = 0;
    For[j = 3, j < ee/2, j += 2,
      If[PrimeQ[j] == True && PrimeQ[ee - j] == True,
       If[PrimeQ[ee + j] == True, a += 1, a = a]]];
    Print[ee, " ", a]]

Extensions

Definition corrected by Robert Israel, Jul 20 2020