login
Bisection of A112046.
4

%I #17 May 06 2021 12:20:18

%S 2,3,2,3,2,5,2,3,2,3,2,7,2,3,2,3,2,5,2,3,2,3,2,5,2,3,2,3,2,11,2,3,2,3,

%T 2,5,2,3,2,3,2,13,2,3,2,3,2,5,2,3,2,3,2,5,2,3,2,3,2,7,2,3,2,3,2,5,2,3,

%U 2,3,2,17,2,3,2,3,2,5,2,3,2,3,2,5,2,3,2,3,2,19,2,3,2,3,2,5,2,3,2,3,2

%N Bisection of A112046.

%H Vincenzo Librandi, <a href="/A112048/b112048.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A112046(2n).

%t a112046[n_]:=Block[{i=1}, While[JacobiSymbol[i, 2n + 1]==1, i++]; i]; Table[a112046[2n] , {n, 101}] (* _Indranil Ghosh_, May 24 2017 *)

%o (Python)

%o from sympy import jacobi_symbol as J

%o def a112046(n):

%o i=1

%o while True:

%o if J(i, 2*n + 1)!=1: return i

%o else: i+=1

%o def a(n): return a112046(2*n)

%o print([a(n) for n in range(1, 102)]) # _Indranil Ghosh_, May 24 2017

%Y Cf. A112046, A112047, A112053.

%K nonn

%O 1,1

%A _Antti Karttunen_, Aug 27 2005