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).
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
Keywords
Examples
a(2) = 11 because for (p,q) = (3,11), 11^3 == 1 (mod 7) and 3^11 == 1 mod 23.
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
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 *)
Comments