Answer:
%% Positive Integer between 100 and 1,000 with Identical Digits
% Initialize variables
n = 0;
sum = 0;
% Loop until an integer is found that meets the requirements
while sum < 100 || sum > 1000 || length(unique(num2str(sum))) ~= 1
n = n + 1;
sum = sum + n;
end
% Print the integer and corresponding sum
fprintf('The integer is %d and the sum is %d.\\', n, sum);