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.

A122170 Number of primes p <= 2n such that p+n is also a prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 0, 3, 1, 4, 1, 5, 0, 4, 1, 4, 1, 6, 0, 4, 1, 4, 0, 10, 0, 6, 1, 5, 1, 12, 0, 5, 0, 6, 1, 13, 0, 7, 1, 9, 1, 13, 0, 7, 1, 6, 0, 13, 0, 9, 1, 7, 0, 14, 0, 12, 1, 7, 1, 19, 0, 7, 0, 10, 1, 20, 0, 11, 1, 13, 1, 15, 0, 8, 0, 10, 1, 18, 0, 12, 1, 8, 0, 23, 0, 10, 1, 10, 0, 26, 0, 13, 0, 13
Offset: 1

Views

Author

Lekraj Beedassy, Aug 23 2006

Keywords

Comments

a(n)=0 for n in A007921.

Examples

			a(12)=5 because only the 5 primes p=5,7,11,17,19 below 24 form other primes p+12 = 17,19,23,29,31.
		

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..3000,2)]);
    f:= proc(n) local m,R;
      m:= ListTools:-BinaryPlace(P,3*n);
      R:= convert(P[1..m],set);
      nops((R -~ n) intersect R)
    end proc:
    f(1):= 1:
    map(f, [$1..1000]); # Robert Israel, Mar 22 2023
  • Mathematica
    Table[Length[Select[Select[Range[2*n], PrimeQ], PrimeQ[ #+n]&]], {n, 100}] (* Ryan Propper, Nov 12 2006 *)

Extensions

More terms from Ryan Propper, Nov 12 2006