restart: alpha := 85; # Change input # To calculate Q_infinity, one needs to be able to calculate the # so-called address T := proc(n:posint) if type(n,odd) then (3*n+1)/2 else n/2 fi end: x := proc(n:posint,j:nonnegint) modp((T@@j)(n),2); end: x(alpha,0), x(alpha,1);