login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A034700
a(n) = smallest prime == 1 (mod 4) such that a(n) is a square mod a(i), all i<n.
2
5, 29, 109, 281, 349, 1601, 1889, 5581, 12421, 14389, 16829, 89501, 294761, 471781, 1134389, 2465081, 2708941, 4695809, 9594709, 33660421, 38692009, 75670769, 138202481, 150274469, 517777769, 3675456101, 4720745641, 27541365749, 29340233569, 69737217721, 112295532029
OFFSET
1,1
COMMENTS
a(n) is also smallest prime == 1 (mod 4) such that a(i) is a square mod a(n), all i<n. Thus each a(i) is a square mod each a(j), i<>j.
MATHEMATICA
next[p_] := If[ Mod[np = NextPrime[p], 4] != 1, next[np], np]; s = {next[2]}; Print[ s[[1]] ]; squareModQ[p_, q_] := (Reduce[ Mod[p - x^2, q] == 0, x, Integers] =!= False); ok[p_] := (r = True; Do[ If[ squareModQ[p, s[[k]] ] === False, r = False; Break[] ], {k, 1, Length[s]} ]; r); grow := (p = next[ Last[s] ]; While[ ok[p] === False, p = next[p] ]; Print[p]; AppendTo[s, p]); Do[ grow, {24} ]; A034700 = s (* Jean-François Alcover, Apr 04 2012 *)
PROG
(Haskell)
a034700 n = a034700_list !! (n-1)
a034700_list = f [1, 5..] [1] where
f (x:xs) ys | a010051' x == 1 &&
(and $ map (isSquMod x) ys) = x : f xs (x:ys)
| otherwise = f xs ys
isSquMod u v = v `mod` u `elem` (map ((`mod` u) . (^ 2)) [0..u-1])
-- Reinhard Zumkeller, Mar 28 2012
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
E. M. Rains (rains(AT)caltech.edu)
EXTENSIONS
More terms from David W. Wilson
a(26)-a(31) from Giovanni Resta, Aug 09 2018
STATUS
approved