Karim Belabas on Sat, 22 Jul 2023 09:40:19 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Is list correct datatype for dynamically building results?
|
- To: hermann@stamm-wilbrandt.de
- Subject: Re: Is list correct datatype for dynamically building results?
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Sat, 22 Jul 2023 09:35:24 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1690011316; c=relaxed/relaxed; bh=E6evaWsTiCe8WWv52lQYAKqSup3wWvlzEnCmS8Mkx/8=; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=pqXDCHn2sz7lV0bl91/TuWiwPRVTaBbYIlm2UQEFn9ivYFBWX59tityLzD0ub5hyjQQ6tw245hheL33kKVKixWq3ZayRNFnZN3exPfIMoGUVvJ3WC38/mzSd1pWoywgjl4Tsm3B+DxHnFo8BWi/d3+MW6DKAy4gaZuPA3teQglSrgZCLNWdtUo6c658HrS9IvXOKDDSIB1Lz12WB2aXGLwVdPAJ3DwBCPZ9CpUqBBmoYS2Tl7uLdCiUXDPpYcWSPh2bAZ8IHc44jmpkQMn9953lRsUsUBA2YHJkYQTg1DDIMmINwvNGxxbJeokfBt2u9XtrYYyHDJkcSUXgbUtgJ/elBL0sZVSeHpmrV9g8sydKqK0EpufjvJ2ZDEg4Nd4foVpYJhmYU/+WW7ZMa5/IGlHy+nwSu5OoLeYR2Wi0ehwVl8ukRiZePd8tmi0CLbEZGQ+JSWDVGuf2OYsqvHsjjDfB8AWUxctHHMMBTHNYR7nYAH4V40S1qSd7BiNHnr05beQjpUIp9bHdZ4UpR0qE1Qs6xdImp1lf4BhnVrEPqN0LQqqzoa3FsSVAutc+TYGJ7q8hok6QM0qt0t4x3Kb54u5v5ruAMFsN3VMEpv9DgTzjiI8o3P83F12U5G2kXb2F7AJ4k2H4IGpCcIyhyOh6IezPivHEDxVuzsgVoJOT9VAk=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1690011316; cv=none; b=lORfBOL3uau1vmjEpXwqvPIhvZmWn4xmWAHgAkLEkDrxxcuhv/tYKSw+eArGMOVhCbEE0T/URgS85hw2GoXb3w9+ylQGHmAW2NF6z+3btxSWladPa9IlKxexQNNSzDbiOSoqSsaNMU+jybkFOtQZUW9BowC2UnGg6G7pWvGidzGcyxck9aPW07uE+Y5MpXg+zyBgAuxCM6Z2/bIY5o4PmdRKZ50t8AJ3eGRXJVYaPFkJSTpfELLdsF6mrQxRDzWbkJpPqPsjrLELpJNa47jXP0kDtS4kq84WNcCCPCedZxhhUwnd4+8PZkmk/4j6LBh87T7t/7A/NP1uuJoVYmBzJqIqlQomHJtGrqlOBfaxx0NVKOLxm/qdVF3TryBM6syB7eaoB+HWTlLbVf4BGoxEl9cJCkEUMR4CvLOZ+iIYV1oWxS5Utf+JDVa+j6vvKPmW6cQUYwsnOjuHR+AamCMoZcrcqVRy5TJw2lVXlTkuct2k9LT+pDwyg9whod0ddySQXnRZqATcsFTDe9gzPM+W0B+ANFaeUrisCMZYwcHzjIXOvtt/0JITNPc3PsluvE32Rd8VBKXAoX0kNsSULMvUCRibV26CFr1ZRu7fLYDq+z9bQtsZhZBvccwrPXxis1/7AfH2wAAqi+8xaF6U5OYo9wAykJyysAVk9IwIg0ZJCs4=
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Sat, 22 Jul 2023 09:40:19 +0200
- In-reply-to: <122c3a9fa45223f286c1969ebd95060e@stamm-wilbrandt.de>
- Mail-followup-to: hermann@stamm-wilbrandt.de, pari-users@pari.math.u-bordeaux.fr
- References: <122c3a9fa45223f286c1969ebd95060e@stamm-wilbrandt.de>
* hermann@stamm-wilbrandt.de [2023-07-22 02:10]:
[...]
> Until now I used "smallest_qnr(n)" function to return smallest quadratic
> non-residue (mod n).
>
> I extended definition to return c smallest quadratic non-residues:
>
> ? smallest_qnr(m,s=2,c=1) = {
> l=List();
> for(c=-c,-1,
> forprime(t=s, oo,
> if(kronecker(t, m)==-1,
> listput(l,t);
> s=t+1;
> break()
> )
> )
> );
> l
> };
That function doesn't quite achieve what you claim. Precisely, it
returns the smallest integers t with kronecker(t, m) = -1, which
are the same as quadratic non residues only if m is prime.
If m is composite, say m = a * b, then you may end up with
kronecker(t,a) = kronecker(t,b) = -1
for a smaller t that the ones you return. Such t's are not quadratic
residues mod m although your kronecker(t, m) == -1 test won't detect them.
E.g.,
? kronecker(2,9)
%1 = 1; \\ obviously; since kronecker(2, 3) = -1
? issquare(Mod(2,9))
%2 = 0;
? [i^2 % 9 | i <- [0..8]]
%3 = [0, 1, 4, 0, 7, 7, 0, 4, 1]
Cheers,
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/