How many natural numbers from 1 to 2 to the power N, where N = 10, have the sum of the digits a multiple of four?

How many natural numbers from 1 to 2 to the power N, where N = 10, have the sum of the digits a multiple of four? A comment. For example, for N = 3N = 3 the following numbers are considered: 1, 2, 3, 4,…, 8. The sum of the digits is a multiple of four in two of them.

Let’s compose a loop for finding the number of numbers for the Pascal programming language
var i, i2, sum, ans: integer;
s: string;
begin
for i: = 1 to 1024 do
begin
sum: = 0
s: = IntToStr (i);
for i2: = 1 to length (s) do
sum: = sum + StrToInt (s [i2]);
if sum mod 4 = 0 then
inc (ans);
end;
writeln (ans);
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.