login
A053665
Smallest number m such that m = j^2 (mod prime(j)) for 1 <= j <= n.
1
1, 1, 19, 79, 289, 18769, 198949, 6325069, 103321969, 1218786319, 98264184769, 3708353007109, 226330497051409, 2964582868796299, 120709434853826569, 21641851825451025919, 738603338323632009979
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
Sequence in context: A201783 A139941 A127270 * A050522 A366965 A172973
KEYWORD
easy,nonn
AUTHOR
Joe K. Crump (joecr(AT)carolina.rr.com), Feb 16 2000
STATUS
approved