login
Numbers k such that k is a quadratic residue modulo reverse(k) and reverse(k) is a quadratic residue modulo k.
1

%I #13 Oct 14 2024 01:34:53

%S 1,2,3,4,5,6,7,8,9,10,11,15,22,29,33,37,38,40,44,47,51,55,56,65,66,73,

%T 74,77,78,79,83,87,88,90,92,97,99,100,101,110,111,113,117,121,124,125,

%U 131,141,143,144,146,149,151,161,163,164,167,169,171,174,181,187,189,191,198,202,209,212,222,226,232,242,252,262,263,266

%N Numbers k such that k is a quadratic residue modulo reverse(k) and reverse(k) is a quadratic residue modulo k.

%e 38 is in the sequence because L(38/83) = L(83/38) = 1, where L(a/b) is the Legendre symbol of a and b, which is defined to be 1 if a is a quadratic residue (mod b) and -1 if a is a quadratic non-residue (mod b).

%p with(numtheory): for n from 1 to 300 do: s:=0:l:=length(n):for q from 0 to

%p l-1 do:x:=iquo(n, 10^q):y:=irem(x, 10):s:=s+y*10^(l-1-q): od: if quadres(n,s)=1

%p and quadres(s,n)=1 then printf(`%d, `,n):else fi:od:

%K nonn,base

%O 1,2

%A _Michel Lagneau_, Dec 13 2010