cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A220295 Least prime q satisfying q^p == 1 (mod 2p+1) and p^q == 1 (mod 2q+1), or 0 if otherwise, where p = prime(n).

Original entry on oeis.org

11, 11, 5, 0, 2, 0, 281, 0, 3, 3, 0, 0, 11, 0, 761, 3, 15233, 0, 0, 2003, 0, 0, 89, 5, 0, 11369, 0, 431, 0, 3, 0, 2, 15401, 0, 2393, 0, 0, 0, 14741, 11, 2, 0, 2, 0, 7901, 0, 0, 0, 11831, 0, 3, 2, 0, 2, 7211, 235043, 10781, 0, 0, 3, 0, 29, 0, 31151, 0, 77471, 0
Offset: 1

Views

Author

Michel Lagneau, Feb 19 2013

Keywords

Comments

The numbers p and q that are the members of the solution (p,q) satisfying q^p == 1 (mod 2p+1) and p^q == 1 (mod 2q+1) where p and q are prime.
q^p == 1 (mod 2p+1) and p^q == 1 (mod 2q+1) has no solution if p is a prime of the form 6m+1 (A002476) => a(n) = 0.

Examples

			a(2) = 11 because for (p,q) = (3,11), 11^3 == 1 (mod 7) and 3^11 == 1 mod 23.
		

Crossrefs

Programs

  • Maple
    with(numtheory):T:=array(1..100):T[1]:=2:T[2]:=3:
             for n from 3 to 100 do :
                p:=ithprime(n):if irem(p,6)=5 then
               T[n]:=p:else T[n]:=0:
               fi:
             od:
              print(T):
                   for a from 1 to 50 do:
                          p:=T[a]: if p= 0 then
                          printf(`%d, `,0):
                          else :
                           ii:=0:
                      for b from 1 to 10^8 while(ii=0) do:
                      q:=ithprime(b):  if  irem(p^q, 2*q+1) = 1 and irem(q^p, 2*p+1)=1 then
                      ii:=1: printf(`%d, `,q):
                     else :
                     fi:
                    od:
                    fi:
                 od:
  • Mathematica
    Table[p = Prime[n]; If[Mod[p, 6] == 1, 0, q = 2; While[! (PowerMod[p, q, 2 q + 1] == 1 && PowerMod[q, p, 2 p + 1] == 1), q = NextPrime[q]]; q], {n, 100}] (* T. D. Noe, Feb 22 2013 *)
Showing 1-1 of 1 results.