login
Primes p such that p is a quadratic residue modulo reverse(p) and reverse(p) is a quadratic residue modulo p.
1

%I #15 Mar 30 2012 18:35:53

%S 29,37,47,73,79,83,97,113,149,163,167,263,277,283,311,317,349,359,389,

%T 421,433,449,461,509,521,607,617,641,761,941,953,983,1009,1021,1031,

%U 1033,1069,1097,1109,1153,1181,1193,1201,1213,1231,1237,1283,1301,1321

%N Primes p such that p is a quadratic residue modulo reverse(p) and reverse(p) is a quadratic residue modulo p.

%C Primes in A177872, excluding the palindromic primes A002385.

%H Eric W. Weisstein, <a href="http://mathworld.wolfram.com/QuadraticResidue.html">Quadratic Residue</a>

%H Eric W. Weisstein, <a href="http://mathworld.wolfram.com/JacobiSymbol.html">Jacobi Symbol</a>

%e Prime 317 is in the sequence because J(317, 713) = J(713, 317) = 1 where J is the Jacobi symbol.

%p with(numtheory): for n from 1 to 2500 do: s:=0:l:=length(n):for q from 0 to l do:x:=iquo(n, 10^q):y:=irem(x, 10):s:=s+y*10^(l-1-q): od: if s<>n and quadres(n,s)=1 and quadres(s, n)=1 and type(n, prime)=true then printf(`%d, `, n):else fi:od:

%Y Cf. A177872, A178399.

%K nonn,base

%O 1,1

%A _Michel Lagneau_, Dec 13 2010