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.

A242366 Primes p such that p1 = ceiling(p/2) + p is prime and p2 = floor(p1/2) + p is prime.

Original entry on oeis.org

2, 3, 11, 59, 131, 179, 347, 1259, 1571, 1979, 2027, 2411, 2699, 2819, 3251, 3347, 4211, 5051, 5099, 5171, 5531, 6779, 7187, 8747, 10091, 12227, 13259, 13451, 13499, 13931, 14411, 14771, 15131, 15467, 16451, 16691, 17987, 18131, 18539, 18731, 18899, 19211
Offset: 1

Views

Author

Keywords

Comments

All terms after 2 are congruent to 3 mod 8, as this is needed for p, p1 and p2 to be odd. If p = 3 + 8*k, then p1 = 5 + 12*k and p2 = 5 + 14*k.

Examples

			11 is in the sequence since 11, ceiling(11/2) + 11 = 17 and floor(17/2) + 11 = 19 are all primes.
		

Crossrefs

Cf. A158714.

Programs

  • Maple
    N:= 100000: # to get all terms <= N
    filter:= proc(p) local p1, p2;
    if not isprime(p) then return false fi;
    p1:= ceil(p/2)+p;
    if not isprime(p1) then return false fi;
    p2:= floor(p1/2)+p;
    isprime(p2);
    end;
    select(filter,[2, seq(3+8*k, k=0 .. floor((N-3)/8))]);
  • Mathematica
    M = 100000;
    filterQ[p_] := Module[{p1, p2},
    If[!PrimeQ[p], Return[False]];
    p1 = Ceiling[p/2] + p;
    If[!PrimeQ[p1], Return[False]];
    p2 = Floor[p1/2] + p;
    PrimeQ[p2]];
    Select[Join[{2}, Table[3+8*k, {k, 0, Floor[(M-3)/8]}]], filterQ] (* Jean-François Alcover, Apr 27 2019, from Maple *)