OFFSET
1,1
COMMENTS
n is in the sequence if either: 1) n is an odd prime 2) n = 2 p where p is an odd prime and exactly one of 1+2p and 2+p is prime 3) n = 4 p where p is an odd prime and both 2p+1 and 2+p are prime
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
12 is included because of 1+12, 2+6, 3+4, only 2+6 is composite;
16 is not because 2+8 and 4+4 are both composite.
MAPLE
S:= NULL: for n from 1 to maxN do ct:= 0; for d in numtheory[divisors](n) do if d^2 > n then next fi; if not isprime(d+n/d) then ct:= ct+1; if ct > 1 then break fi fi; od; if ct = 1 then S:= S, n fi; od: S;
MATHEMATICA
M = 200; Reap[For[n = 1, n <= M, n++, ct = 0; Do[If[d^2 > n, Continue[]]; If[CompositeQ[d + n/d], ct++; If[ct > 1, Break[]]], {d, Divisors[n]}]; If[ct == 1, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Apr 29 2019, from Maple *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Robert Israel, Sep 03 2004
EXTENSIONS
Offset changed by Robert Israel, Feb 26 2019
STATUS
approved