This site is supported by donations to The OEIS Foundation.



Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 4500 articles have referenced us, often saying "we would not have discovered this result without the OEIS".

(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A034791 a(n) is square mod a(i), i < n. 3


%S 1,2,7,14,31,62,113,226,233,466,647,1294,1487,2974,4919,6329,7951,

%T 12658,15902,26329,26833,47737,52658,53623,53666,95474,107246,128959,

%U 135697,142327,271394,284654,715177,1312777,1430354,1474657,2625554

%N a(n) is square mod a(i), i < n.

%C Apparently A034698 is a subsequence and all elements are products of elements of A034698.

%C a(n) is the smallest integer larger than a(n-1) such that all a(i), 1<=i<n, are quadratic residues mod a(n). - _R. J. Mathar_, Jul 27 2015

%p A034791 := proc(n)

%p option remember;

%p local a,wrks ;

%p if n = 1 then

%p 1;

%p else

%p for a from procname(n-1)+1 do

%p wrks := true;

%p for i from 1 to n-1 do

%p if numtheory[quadres](procname(i),a) <> 1 then

%p wrks := false;

%p end if;

%p end do;

%p if wrks then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Jul 27 2015

%o (Haskell)

%o a034791 n = a034791_list !! (n-1)

%o a034791_list = 1 : f [2..] [1] where

%o f (x:xs) ys | and $ map (flip isSquMod x) ys = x : f xs (x:ys)

%o | otherwise = f xs ys

%o isSquMod u v = u `mod` v `elem` (map ((`mod` v) . (^ 2)) [0..v-1])

%o -- _Reinhard Zumkeller_, fixed Jul 29 2015, Mar 28 2012

%Y Cf. A034698.

%Y Cf. A034793, A034903.

%K nonn

%O 1,2

%A _David W. Wilson_

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

Content is available under The OEIS End-User License Agreement .

Last modified November 25 18:43 EST 2015. Contains 264418 sequences.