[seqfan] Re: More rows of triangle in A271100?

David Corneth davidacorneth at gmail.com
Mon May 16 20:19:21 CEST 2016


Hello Bruce,

I'm not aware of PARI having this feature. Today I proposed a similar
suggestion to the SeqFan, which is yet to be placed.
I did manage to put up a matrix m. With entries 0 or 1. 0 denotes (p, q)
don't have Mod(p, q^2)^(q - 1) == 1. 1 denotes p and q have. Computing m^s
yields all some 1's on the main diagonal. The correspongding prime is in
some number tuple. However, the matrix gets big very fast, so this approach
won't work.

Great that you managed to code it up anyway!

Best regards,
David

On Mon, May 16, 2016 at 10:12 AM, Bruce Leenstra <maybeso83 at gmail.com>
wrote:

> Hello Felix et all,
>
> I see that David added Pari code to the sequence. This week I jumped
> into cloud sagemath and wrote a worksheet to generate rows. The
> digraph structure does all the work - does Pari have something
> similar? I don't know either one well enough to compare/combine them.
>
> Best Regards,
> Bruce Leenstra
>
> pr = prime_range(3600) # 7400 *determines how many rows get found.
> wief = DiGraph([pr, lambda p, q: power_mod(p, q - 1, q^2) == 1])
> sc = wief.all_simple_cycles() # could take a while!
> sc.append([0, 0])
> maxn = 0
> for c in sc: # reverse lexicographic
>     del c[0] # duplicate
>     maxn = max(maxn, len(c))
>     c.sort(reverse=True)
> # group by length
> tbl = [[c for c in sc if len(c) == n] for n in range(maxn)]
> n = 0
> for t in tbl: # sort tuples by first element, get smallest
>     if len(t) > 0:
>         t.sort(key=lambda x: x[0])
>         print 'n=%s: %s'%(n, t[0])
>     n = n + 1
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list