% powers_of_2_sequence.m
%  Compute and print the elements of the powers-of-2 sequence.
%  1, 2, 4, 8, 16, ...
%  A(i) = 2^i for i = 0, ..., n.
%
n = input ( 'Enter the highest index to compute: ' );

for i = 0 : n

  value = 2^i;
  fprintf ( 'a(%d) = %d\n', i, value );

end

