The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A362502 Least k > 0 such that (floor(sqrt(n*k)) + 1)^2 mod n is a square. 1

%I #36 May 29 2023 00:08:27

%S 1,1,1,1,1,2,3,1,3,4,5,1,7,8,1,1,9,4,11,2,1,14,15,1,8,16,1,3,19,2,21,

%T 1,3,24,1,2,25,26,3,1,29,2,31,6,1,34,35,1,15,4,3,7,39,4,1,2,3,44,45,1,

%U 47,48,1,2,1,4,51,10,5,2,55,1,57,58,5,12,1,6,63,1,5,64,65,1,3,68

%N Least k > 0 such that (floor(sqrt(n*k)) + 1)^2 mod n is a square.

%H Winston de Greef, <a href="/A362502/b362502.txt">Table of n, a(n) for n = 1..10000</a>

%t nmax=86; a={}; For[n=1, n<=nmax, n++, For[k=1, k>0, k++, If[IntegerQ[Sqrt[Mod[Floor[Sqrt[n k]+1]^2, n]]], AppendTo[a,k]; k=-1]]]; a (* _Stefano Spezia_, Apr 24 2023 *)

%o (Python)

%o from gmpy2 import is_square, isqrt

%o def a(n):

%o m,k = 2,0

%o while not is_square(m):

%o k+=1

%o m = pow(isqrt(n * k) + 1, 2, n)

%o return k

%o (PARI) a(n) = my(k=1); while(!issquare((sqrtint(n*k)+1)^2 % n), k++); k; \\ _Michel Marcus_, Apr 24 2023

%K nonn

%O 1,6

%A _DarĂ­o Clavijo_, Apr 22 2023

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 07:02 EDT 2024. Contains 372729 sequences. (Running on oeis4.)