login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A034698 a(n) = smallest prime such that a(1), ..., a(n-1) are squares mod a(n). 3
2, 7, 31, 113, 233, 647, 1487, 4919, 6329, 7951, 26833, 47737, 53623, 128959, 135697, 142327, 1312777, 3178289, 6061607, 26564393, 32426081, 102958417, 209074609, 323901311 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..24.

MATHEMATICA

residueQ[n_, p_] := JacobiSymbol[n, p] == 1; a[1] = 2;  a[n_] := a[n] = For[r = Range[n - 1]; p = NextPrime[a[n - 1]], True, p = NextPrime[p], If[AllTrue[r, residueQ[a[#], p] &], Return[p]]]; Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 24}] (* Jean-François Alcover, Feb 16 2018 *)

PROG

(Haskell)

a034698 n = a034698_list !! (n-1)

a034698_list = f [2..] [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

Cf. A034700.

Cf. A010051, A034791.

Sequence in context: A213721 A102162 A059846 * A115605 A289719 A114198

Adjacent sequences:  A034695 A034696 A034697 * A034699 A034700 A034701

KEYWORD

nonn,nice,changed

AUTHOR

E. M. Rains (rains(AT)caltech.edu)

EXTENSIONS

More terms from David W. Wilson

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 19 02:06 EST 2018. Contains 299330 sequences. (Running on oeis4.)