login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Semiprimes p*q such that 2^p mod q == 2^q mod p.
3

%I #21 Jun 27 2024 22:16:11

%S 4,9,25,49,121,169,289,341,361,529,731,841,961,1333,1369,1387,1681,

%T 1727,1849,2047,2209,2701,2809,3277,3481,3503,3721,3763,4033,4369,

%U 4489,4681,5041,5329,5461,6241,6889,7921,7957,8321,9409,9509,10201,10261,10609,10669,11449,11881

%N Semiprimes p*q such that 2^p mod q == 2^q mod p.

%C The square of every prime is here, as are the semiprimes in A179839.

%H Amiram Eldar, <a href="/A179707/b179707.txt">Table of n, a(n) for n = 1..10000</a>

%e 341 is a term because 341 = 11*31 and 2^11 mod 31 = 2^31 mod 11.

%t fQ[n_] := Block[{fi = Flatten[ Table[ First@ #, {Last@ #}] & /@ FactorInteger@ n]}, Length@ fi == 2 && PowerMod[2, fi[[2]], fi[[1]]] == PowerMod[2, fi[[1]], fi[[2]]]]; Select[ Range@ 12000, fQ]

%t With[{nn=50},Take[Union[Times@@@Select[Tuples[Prime[Range[2nn]],2], PowerMod[ 2,#[[1]],#[[2]]]==PowerMod[2,#[[2]],#[[1]]]&]],nn]] (* _Harvey P. Dale_, Sep 03 2015 *)

%Y Cf. A001358, A001567.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Jan 10 2011