OFFSET
1,5
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
Eric Weisstein's World of Mathematics, Quadratic Residue
MATHEMATICA
Table[r=Range[n]; Max[Mod[r^2, n]], {n, 100}] (* T. D. Noe, Dec 18 2008 *)
Table[r = Range[1 + n/2]; Max[Mod[r^2, n]], {n, 100}] (* Zak Seidov, Dec 18 2008 *)
PROG
Contribution from Michael B. Porter, May 04 2010: (Start)
(PARI) residue(n, m)={local(r); r=0; for(i=0, floor(m/2), if(i^2%m==n, r=1)); r}
A047210(n)={local(r, m); r=0; m=n; while(r==0, m=m-1; if(residue(m, n), r=1)); m} (End)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Jun 08 2000
STATUS
approved