function powers2 ( n )

%% POWERS2 compares 2^N and 2^N-1

  p = 2 ^ n;
  fprintf ( 1, '  2^%d     = %d\n', n, p );
  pm1 = p - 1;
  fprintf ( 1, '  2^%d - 1 = %d\n', n, pm1 );

  r = mod ( p, 1000 );
  fprintf ( 1, '  Last 3 digits of 2^%d     are %d\n', n, r );
  rm1 = mod ( pm1, 1000 );
  fprintf ( 1, '  Last 3 digits of 2^%d - 1 are %d\n', n, rm1 );

  return
end

