login
Primes such that their quadruple is not 1 away from a prime number.
1

%I #8 May 09 2015 09:08:44

%S 19,23,29,31,47,59,61,89,101,103,107,109,113,149,151,157,167,179,181,

%T 191,211,223,229,233,239,241,251,257,269,271,283,311,313,317,331,337,

%U 347,349,353,359,367,379,389,397,401,419,421,439,443,449,457,461,463

%N Primes such that their quadruple is not 1 away from a prime number.

%C This sequence is a variation of the sequence in the reference. However, this sequence should have an infinite number of terms. k=4 in the PARI code.

%D R. Crandall and C. Pomerance, Prime Numbers A Computational Perspective, Springer Verlag 2002, p. 49, exercise 1.18.

%H Harvey P. Dale, <a href="/A120640/b120640.txt">Table of n, a(n) for n = 1..10000</a>

%e 19*4 = 76, which is one away from 75 and 77 both not prime.

%t Select[Prime[Range[100]],AllTrue[4#+{1,-1},CompositeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, May 09 2015 *)

%o (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",") ) ) }

%K easy,nonn

%O 1,1

%A _Cino Hilliard_, Aug 17 2006