login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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).
1
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,1
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.
EXAMPLE
a(2) = 11 because for (p,q) = (3,11), 11^3 == 1 (mod 7) and 3^11 == 1 mod 23.
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 19 2013
STATUS
approved