%I #10 Feb 01 2016 11:37:40
%S 1,2,3,4,5,6,7,8,9,10,13,15,17,18,22,27,31,36,37,38,39,40,41,45,54,58,
%T 62,63,66,71,72,74,77,79,81,82,83,86,88,89,90,97,100,103,106,108,111,
%U 112,114,117,121,122,126,130,131,133,135,137,138,139,141,144,150,153,156,157,159,161,162,163,167,169,171,177,178,179,180
%N Numbers k such that sum of the decimal digits of k is a quadratic residue modulo k.
%e 159 is in the sequence because L((1+5+9)/159) = L(15/159) = 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 isA177053 := proc(n) is(numtheory[quadres](A007953(n),n) =1 ); end proc:
%p for n from 1 to 140 do if isA177053(n) then printf("%d,",n); end if; end do: # _R. J. Mathar_, Dec 12 2010
%o (PARI) isok(n) = issquare(Mod(sumdigits(n), n)); \\ _Michel Marcus_, Feb 01 2016
%K nonn,base
%O 1,2
%A _Michel Lagneau_, Dec 09 2010
|