login
Least positive integer k for which the Jacobi symbol (k|2*n-1) is less than 1, where 2*n-1 is a nonsquare; a(n)=0 if 2*n-1 is a square.
3

%I #32 Apr 19 2019 02:52:42

%S 0,2,2,3,0,2,2,3,3,2,2,5,0,2,2,3,3,2,2,3,3,2,2,5,0,2,2,3,3,2,2,3,3,2,

%T 2,7,5,2,2,3,0,2,2,3,3,2,2,5,5,2,2,3,3,2,2,3,3,2,2,7,0,2,2,3,3,2,2,3,

%U 3,2,2,5,5,2,2,3,3,2,2,3,3,2,2,5,0,2,2,3,3,2,2,3,3,2,2,7,5,2,2,3

%N Least positive integer k for which the Jacobi symbol (k|2*n-1) is less than 1, where 2*n-1 is a nonsquare; a(n)=0 if 2*n-1 is a square.

%D Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 443-448.

%D Paulo Ribenboim, The New Book of Prime Number Records, 3rd ed., Springer-Verlag 1996; Math. Rev. 96k:11112.

%H Antti Karttunen, <a href="/A053761/b053761.txt">Table of n, a(n) for n = 1..10000</a>

%H R. Baillie and S. S. Wagstaff, <a href="http://dx.doi.org/10.1090/S0025-5718-1980-0583518-6">Lucas pseudoprimes</a>, Math. Comp. 35 (1980) 1391-1417; Math. Rev. 81j:10005

%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/hdmrd/jacobi.html">Quadratic Residues</a> [Broken link]

%H Steven R. Finch, <a href="http://web.archive.org/web/20010208112444/http://www.mathsoft.com/asolve/constant/hdmrd/jacobi.html">Quadratic Residues</a> [From the Wayback machine]

%F a(1) = 0; for n > 1, a(n) = (1-A010052((2*n)-1)) * A112046(n-1). - _Antti Karttunen_, May 10 2017

%p A053761 := proc(n) if issqr(2*n-1) then return 0 ; else for k from 1 do if numtheory[jacobi](k,2*n-1) < 1 then return k; end if; end do: end if; end proc: seq(A053761(n),n=1..100) ; # _R. J. Mathar_, Aug 08 2010

%t a[n_] := If[IntegerQ[Sqrt[2*n - 1]], Return[0], For[ k = 1, True, k++, If[ JacobiSymbol[k, 2*n - 1] < 1 , Return[k]]]]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Jun 20 2013, after _R. J. Mathar_ *)

%o (PARI)

%o A112046(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(i)));

%o A053761(n) = if(issquare((2*n)-1),0,A112046(n-1));

%o for(n=1, 10000, write("b053761.txt", n, " ", A053761(n))); \\ _Antti Karttunen_, May 10 2017

%o (Scheme) (define (A053761 n) (if (= 1 n) 0 (* (- 1 (A010052 (+ n n -1))) (A112046 (- n 1))))) ;; _Antti Karttunen_, May 10 2017

%Y Cf. A010052, A053760, A112046, A112049, A268829.

%K nonn

%O 1,2

%A _Steven Finch_, Apr 05 2000

%E More terms from _R. J. Mathar_, Aug 08 2010