Bill Allombert on Wed, 25 Jan 2023 11:15:08 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Looking for a smaller solution...
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: Looking for a smaller solution...
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Wed, 25 Jan 2023 11:13:58 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1674641634; c=relaxed/relaxed; bh=IjrEuwg6ZfDfm2jAw9zSLguy8baSQtKy5YD4OCfy17U=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=eS+SvyILtEr9JTO0hd/VfHgIWvgtXYrYtIyYGUOuhrZp2fyhMIiKKCNAY2B4F9rE84WbAjWH9uIadCgl+epi6wkL/Nl4ooWCSSg1mMPodZnH11DTnNIIZCcWV+NewOAlRcKGbDDkuY3GQPptLoUvbvyGUXAl/Dt3RWYf24t0lhjeFnWHRc7+xwkulPEbe3qS4nGtgqXsrkrS0iJgk6mi2V1tEG37Ot7UslSOlKYFI/rTTwK0T1jkNDC3KQrHVVrkRsoInIbZd/jvEm2pmn46r1v8w2h762FUjEDQl2p3tbth79y3J6Uy5qflqpNgUfBOce59RTWu8/SPf5CqdmncGZ3GFj580kPqG+G4NzWPsZoxR5cQ/SG1kznNGrs4y9G787Jgun7KDxrY75BdgF9ZiTULejao2abtv5wew6kCuylqNXduR/xTWtAp9IhRoe494+Ot07ugWt/4MfrWL3W0gwuOVmJQOr2MfHQH7HUpHrhLUCYxTA7nvfT2Pebdb9Ry7l3y5L9znmTV/o/q2I+RIdrlnOFIMkkzuHika0IA0yLZUei/P1qHibgK+rfxqegkMU1QuB6FhrqAT0L1RetdDSY6uqYZLc+XtTYxamV6MwytCquYpeN134zlfHpLCeh3cRxz/EEPqtkqV07ImrNR1aY2xT+9i0xJHT9Mia5zBZY=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1674641634; cv=none; b=Zm7l0vfmgSCw6ga09tFnDh3JY82JlhW0jInwU/T7cK57P3i4oXcVMwxvg826suOEwAE+lnMEReU4LVrT2ge3Li0MVxiOOzeQfYuo9UhyCSPff3jsWLIHaS8wFE3IHdzlgm1DBpJxvDk0GxpQmBvyktvfv+vQnpU7qLG8vYqBFhpmTK3i86H4QuHy63e7HJjZD8KBW0R1ndFQ5Eu/jp8CeYCnhSWDztdOHRTrqAGJraR1dmmnb3y6Cn15wrpqDwT5d8gx7cOxcPpCvQahDdAydU0BF9wG8jwWIMgww1imKsE2XcHMvUxHnCHG1ovJdv172Jmo8TQYNv4VjkupG51oCKubZv51QzQc0uQ5Ql5GHqkZB+4i/KSOnYkJWCol+h7BtQpmKMWfTo59VbbK5HxS+Fh/aa1TvC/fCSYgqZE/WI5I2/FXS8FG8HrfaYIeW8vmI5yATHg/X39Vlp+qx4veRl4DJWEcqIsVtoLXCZRo8HzhsW8D/5fDe6xGFV7u1aeeVJil8A5+3KKlFCFcYVggO0Scjgy7oZc5BY6516iUmDCeEjlQg0a7DVurTwHAJr2NuxSfAD4+6kXo+v7Wzhk+RtEMeUTlWA+w4KVRV2QuWgFUZTBDbgB0mUua+XeG2oZBv4/OaUqcsC8UMdHGG74D6tEa1XOU/PHCNx+Yg513ANs=
- Authentication-results: smail; arc=none
- Delivery-date: Wed, 25 Jan 2023 11:15:08 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1674641634; bh=IjrEuwg6ZfDfm2jAw9zSLguy8baSQtKy5YD4OCfy17U=; h=Date:From:To:Subject:References:In-Reply-To:From; b=q5PJnusg0amyfLsXnBBwYUAbR48dOs3Wzk9kPXJS9D3V0Ekd6DINM5iSHk8GcIuq7 0j0CBWuJeI4SSc7qVKwa/y53z/7lrc+ycvEH8gxFqR98oH7sraCXnOgTSM/+A01t1j kSTDxKolCCt2RBD1kmualB8qx6Bb0j9hQP9VTCx4q3oHztkKWubpsDqn+yZjUWCbcz GeokHNFi3V+rMFzLcYAdE2xMF1Oppgx9j+T7bbx16h4oYEN9b/jmW3sQ4duLxqvgQM 2t+xy6EXnkHozBm8zTg8SgvCWQtnHp1OsymEbvjTU8FtpwC0dDtUlgPeQvNOYI9IAX oEasNlMizEM2nP/2tx0WQZYALdqpyS6tz7GJg9jZWtPoghonhLF9CYI8D4V/kBmFe5 p4T0+KReR8/ME3WYewY/SV1UsD8dLaS4FI581AZpREV1K8KRloKb10bDYFKBUOiJGh eD+hK8pDdN+AbCyQBbmW6Y8ATHJhnK0qxHie+Xx6IIvqNcB7vm30X1m10fJt+wkfqZ MerTZJlJBPPWUliWGlGlFahN9oUPXf5/2sCA2L3MoyKgEpu5sJEw1p9vce8IgUjw2l TfJ9zoKjVMU0NPveM8k3paDz68v9bZdsSh1BWR10+aKcYuhJgI4vCDEJT3N6yijxG6 ShoLSu06/UcdVArMtCAsh96g=
- In-reply-to: <63D09B84.2050705@morpheus.net>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <63D09B84.2050705@morpheus.net>
On Tue, Jan 24, 2023 at 09:01:24PM -0600, wraithx@morpheus.net wrote:
> Hello,
>
> While I was working on a problem, someone offered a Pari/GP solution. While
> it works great, the solution is larger than I'd like. I was wondering if
> there was an alternate way to compute the solution that results in a smaller
> answer?
>
> Here is a simplified version of the problem I'm working on:
> --------------------------------------------------------------------------
> Does anyone know of a way to find, or construct, a number B = k*x + y with x
> and y given, that is only divisible by primes from a finite set of primes P?
>
> For example, if x=97929 and y=83261 and P = [1171, 1429, 1811, 2339], how
> would we find or construct B? Or, perhaps show that one doesn't exist?
>
> I know we could do a brute force search, looping over k values and checking
> the factors of B, but I'm hoping someone might know of a way to construct,
> or constructively find, B. Is this possible?
> --------------------------------------------------------------------------
>
> In the full problem I'm working on, my numbers x and y have a few hundred
> digits, and my set P has over 1000 primes. Also, x has only small prime
> factors p^e, with p a prime < 1000 and where e is usually 1, but can be
> higher, like 2^13, or 3^8, 7^5, etc. Also, all p are less than the smallest
> prime in P, ie no prime is in both sets.
>
> The code that was offered is:
> b(x,y,P)={G=znstar(x,1);matsolvemod(matconcat(vector(#P,i,znlog(P[i],G))),G.cyc~,znlog(y,G))}
> which "outputs a vector giving the exponents that each of the primes in P
> need to be raised to in the product." ie B = product(P[i]^e[i]) where e[i]
> is the output of the above function.
There is an option to matsolvemod to give all solutions:
b(x,y,P)={G=znstar(x,1);matsolvemod(matconcat(vector(#P,i,znlog(P[i],G))),G.cyc~,znlog(y,G),1)}
? [E,M]=b(97929,83261,[1171, 1429, 1811, 2339])
%5 = [[843,1311,325,330]~,[270,204,204,23;0,18,12,6;0,0,6,3;0,0,0,1]]
All the solutions can be written as E+M*v where v is a column vector with integral entries.
So you can try to pick v to get smaller entries, for example take v=[0,0,0,-36]~
? E+M*[0,0,0,-36]~
%13 = [15,1095,217,294]~
Cheers,
Bill