OFFSET
1,1
COMMENTS
For any distinct odd primes p,q, includes all primes == 2 (mod p^3) and == -2 (mod q^3), and thus is infinite by Dirichlet's theorem on primes in arithmetic progressions. Robert Israel, Jan 11 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
4457-2 = 3^4*5*11,4457+2 = 7^3*13
MAPLE
filter:= proc(p)
isprime(p) and ormap(t -> t[2]>=3, ifactors(p+2)[2]) and ormap(t -> t[2]>=3, ifactors(p-2)[2])
end proc:
select(filter, [seq(i, i=3..2*10^5, 2)]); # Robert Israel, Jan 11 2019
MATHEMATICA
filterQ[p_] := PrimeQ[p] && AnyTrue[FactorInteger[p-2], #[[2]] >= 3&] && AnyTrue[FactorInteger[p+2], #[[2]] >= 3&];
Select[Prime[Range[20000]], filterQ] (* Jean-François Alcover, Aug 26 2020 *)
PROG
(PARI) powerfreep4(n, p, k) = { c=0; pc=0; forprime(x=2, n, pc++; if(!ispowerfree(x-k, p) && !ispowerfree(x+k, p), c++; print1(x", "); ) ); print(); print(c", "pc", "c/pc+.0) } ispowerfree(m, p1) = { flag=1; y=component(factor(m), 2); for(i=1, length(y), if(y[i] >= p1, flag=0; break); ); return(flag) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Dec 08 2003
STATUS
approved