OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
P. Fletcher, W. Lindgren and C. Pomerance, Symmetric and asymmetric primes, J. Number Theory 58 (1996) 89-99.
Carl Pomerance, Symmetric primes revisited, arXiv:1908.06161 [math.NT], 2019.
EXAMPLE
23 is asymmetric since gcd(22,q-1)=2<23-q for all odd primes q<23, gcd(22,22)=22>0 and gcd(22,q-1)=2<q-23 for all odd primes 23<q<67.
MATHEMATICA
f[n_] := Block[{k = 2}, While[k < 10^3 && Abs[n - Prime[k]] != GCD[n - 1, Prime[k] - 1], k++ ]; If[k == 10^3, 0, Prime[k]]]; Complement[ Prime[ Range[2, 500]], Select[ Prime[ Range[2, 500]], f[ # ] != 0 &]] (* Robert G. Wilson v, Sep 19 2004 *)
PROG
(PARI) is(n)=if(!isprime(n), return(0)); forprime(q=2, 2*n, if(abs(n-q)==gcd(n-1, q-1), return(0))); 1 \\ Charles R Greathouse IV, Aug 08 2016
(PARI) is(n)=if(!isprime(n), return(0)); fordiv(n\2, d, if(isprime(n-2*d) && gcd(n-1, n-2*d-1)==2*d, return(0)); if(isprime(n+2*d) && gcd(n-1, n+2*d-1)==2*d, return(0))); n>2 \\ Charles R Greathouse IV, Aug 08 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Steven Finch, Jan 21 2004
EXTENSIONS
More terms from Robert G. Wilson v, Sep 19 2004
STATUS
approved