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.

A120638 Primes such that their triple is not 2 away from a prime number.

This page as a plain text file.
%I A120638 #10 Feb 01 2019 15:14:31
%S A120638 2,31,41,73,101,107,109,131,151,157,179,223,229,241,281,283,311,359,
%T A120638 379,389,421,449,463,509,521,547,563,571,599,613,617,619,631,641,647,
%U A120638 653,661,683,691,701,719,733,739,743,773,787,809,811,821,827,829,839,857
%N A120638 Primes such that their triple is not 2 away from a prime number.
%C A120638 This sequence is a variation of the sequence in the reference. However, this sequence should have an infinite number of terms. k=2 in the PARI code.
%D A120638 R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.
%e A120638 31*3 = 93 which is two away from 91 and 95 both not prime.
%t A120638 Select[Prime@Range@200,!PrimeQ[3#-2]&&!PrimeQ[3#+2]&] (* _Vladimir Joseph Stephan Orlovsky_, Apr 25 2011 *)
%t A120638 Select[Prime[Range[200]],NoneTrue[3#+{2,-2},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Feb 01 2019 *)
%o A120638 (PARI) primepm3(n,k) = =number of iterations,k = factor { local(x,p1,p2,f1,f2,r); if(k%2,r=2,r=1); for(x=1,n, p1=prime(x); p2=prime(x+1); if(!isprime(p1*k+r)&!isprime(p1*k-r), print1(p1",") ) ) }
%Y A120638 Cf. A023208, A088878, A125272.
%K A120638 easy,nonn
%O A120638 1,1
%A A120638 _Cino Hilliard_, Aug 17 2006