login
A062729
n not divisible by any prime=p, where either p-2 or p+2 is prime.
5
1, 2, 4, 8, 16, 23, 32, 37, 46, 47, 53, 64, 67, 74, 79, 83, 89, 92, 94, 97, 106, 113, 127, 128, 131, 134, 148, 157, 158, 163, 166, 167, 173, 178, 184, 188, 194, 211, 212, 223, 226, 233, 251, 254, 256, 257, 262, 263, 268, 277, 293, 296
OFFSET
1,2
COMMENTS
Complement of A062506.
n divisible only by single primes A007510. - Zak Seidov, May 11 2015
LINKS
EXAMPLE
46 is included because 46 = 2 * 23 and all (2+2), (2-2), (23+2), (23-2) are composite. (* edited by Zak Seidov, May 11 2015 *)
MAPLE
N:= 1000: # to get all terms <= N
Primes:= select(isprime, {2, (2*i+1)$i=1..ceil((N+1)/2)}):
LTwins:= Primes intersect map(`-`, Primes, 2):
A:= Vector(N):
for p in LTwins do
A[p*[$1..floor(N/p)]]:= 1;
A[(p+2)*[$1..floor(N/(p+2))]]:= 1;
od:
select(t -> A[t]<>1, [$1..N]); # Robert Israel, May 11 2015
MATHEMATICA
Select[Range@296, #==1 || (p = First /@ FactorInteger@#; Nor @@ Flatten@ PrimeQ@ {p+2, p-2}) &] (* Giovanni Resta, May 12 2015 *)
PROG
(PARI) isok(n) = {my(f = factor(n)); for (i=1, #f~, p = f[i, 1]; if (isprime(p-2) || isprime(p+2), return (0)); ); return (1); } \\ Michel Marcus, May 20 2014
CROSSREFS
Cf. A062506, A007510. - Zak Seidov, May 11 2015
Sequence in context: A112395 A004207 A219675 * A004620 A018618 A294364
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 11 2001
EXTENSIONS
Offset changed to 1 by Michel Marcus, May 20 2014
STATUS
approved