login
a(n) = smallest number x such that x^2 == 17 (mod 2^n).
1

%I #39 Feb 03 2023 15:25:20

%S 0,1,1,1,1,7,9,23,23,23,233,279,279,1769,1769,6423,9961,9961,55575,

%T 55575,206569,206569,842007,1255145,2939159,2939159,2939159,2939159,

%U 64169705,64169705,204265751,204265751,869476073,869476073,3425491223,3425491223,13754377961

%N a(n) = smallest number x such that x^2 == 17 (mod 2^n).

%C 17 is the smallest nonsquare that is congruent to a square mod 2^n for any n.

%C Any number that is congruent to a square mod 2^n for any n is of the form (4^a)*(8b+1). Such numbers have density 1/6.

%H Chai Wah Wu, <a href="/A350540/b350540.txt">Table of n, a(n) for n = 0..1000</a>

%t Table[PowerMod[17,1/2,2^k],{k,0,36}] (* _Giorgos Kalogeropoulos_, Jan 31 2023 *)

%o (PARI) a(n) = my(x=0); while (Mod(x, 2^n)^2 != 17, x++); x; \\ _Michel Marcus_, Jan 04 2022

%o (Python)

%o from sympy.ntheory import sqrt_mod

%o def A350540(n): return min(sqrt_mod(17,2**n,all_roots=True)) # _Chai Wah Wu_, Jan 12 2022

%Y Cf. A000290, A000079.

%K nonn

%O 0,6

%A _Tejo Vrush_, Jan 04 2022

%E a(13)-a(28) from _Michel Marcus_, Jan 04 2022

%E a(30)-a(36) from _Alois P. Heinz_, Jan 04 2022

%E Edited by _N. J. A. Sloane_, Jan 12 2022