[GAP Forum] Elementary

Bill Allombert Bill.Allombert at math.u-bordeaux.fr
Thu Jan 21 16:40:38 GMT 2021


On Thu, Jan 21, 2021 at 03:52:35PM +0000, lopo apelo kosho wrote:
> Dear Friends, 
> I am searching for non-negative integers a and b  in an interval  [0,n] such that a divides (2^b-1). 
> It is supposed to have a-any odd number and b=phi(a). I tried to find those values using GAP (please see below) but it seems that I am doing mistake.
> fun:=function(n) local a,b,t;
> t:=[];
> for a in [1..n] do;
> for b in [1..n ] do;
> if 2^b-1 = 0 mod a 

You should write

if (2^b-1) mod a = 0

"2^b-1 = 0 mod a" means "(2^b-1) = (0 mod a)"

Cheers,
Bill



More information about the Forum mailing list