OFFSET
1,3
EXAMPLE
a(3) = 19 because this is the smallest number m such that m = 1^2 (mod 2), m = 2^2 (mod 3) and m = 3^2 (mod 5).
MATHEMATICA
Array[ChineseRemainder @@ Transpose@ Map[{#^2, Prime[#]} &, Range[#]] &, 17] (* Michael De Vlieger, Jan 14 2022 *)
PROG
(PARI) okm(m, n) = {for (i=1, n, pi = prime(i); if ((m % pi) != (i^2 % pi), return (0)); ); return (1); }
a(n) = {m = 1; while (! okm(m, n), m++); m; } \\ Michel Marcus, Sep 02 2013
(PARI) x=Mod(1, 1); for(i=1, 17, x=chinese(x, Mod(i * i, prime(i))); print1(component(x, 2), ", ")) \\ Sean A. Irvine, Jan 11 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joe K. Crump (joecr(AT)carolina.rr.com), Feb 16 2000
STATUS
approved