[seqfan] Re: A214089

Max Alekseyev maxale at gmail.com
Tue Aug 21 22:26:41 CEST 2012


Jonathan,
The algorithm relies on the fact that
a(n) == +1 or -1 (mod prime(i))
for every i=1,2,...,n.
Basically it tries all 2^n possibilities of choosing +1/-1's in the
above congruences, combine them with Chinese Remainder Theorem, and
search for a prime in the corresponding remainder class modulo the
product of n primes. The value of B keeps the smallest found prime so
far.
Regards,
Max

On Tue, Aug 21, 2012 at 7:04 PM, Jonathan Stauduhar <jstdhr at gmail.com> wrote:
> Nice work, Max!
>
> Since I don't know PARI well, does your code check to see if a(n) is
> divisible by the next highest primorial (i.e. a(n+1) = a(n))?  It looks like
> "forstep(s=lift(q), B-1, q.mod, if(ispseudoprime(s), B=s;" is doing this,
> but I can't be sure.  I was going to update my Mathematica code to do this,
> but now I need to understand your algorithm before I bother to make any
> changes.
>
> Cheers,
>
> Jonathan
>
>
> On 8/21/2012 5:35 AM, Max Alekseyev wrote:
>>
>> JFYI, I've extended A214089 to first 30 terms and posted the
>> corresponding PARI/GP.
>> Regards,
>> Max
>>
>> On Tue, Aug 21, 2012 at 12:29 AM, Jonathan Stauduhar<jstdhr at gmail.com>
>> wrote:
>>>
>>> Thanks, Olivier.
>>>
>>>
>>> I finally got what I thought was an improved algorithm working.  It turns
>>> out it's no improvement after all.
>>>
>>> Thank you, T D. Noe, for cleaning up the published code!
>>>
>>>
>>> Jonathan
>>>
>>> _______________________________________________
>>>
>>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>> _______________________________________________
>>
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/



More information about the SeqFan mailing list