
Один богатый дядюшка подарил племяннику 1 доллар в его первый день рождения. В каждый следующий
день рождения он удваивал подарок и прибавлял к нему столько долларов ,сколько лет исполнялось мальчику. Сосчитать,сколько подаренных денег накопиться к 18-летию мальчика

Ответы на вопрос

begin
p:=1; s:=1;
for i:=2 to 18 do
begin
p:=p*2;
s:=s+p+i;
end;
writeln('s = ',s);
end.
Результат:
s = 262313



Calculation of the Accumulated Gift Money by the Boy's 18th Birthday
To calculate the total amount of money gifted to the boy by his 18th birthday, we need to consider that the uncle gave him $1 on his first birthday and then doubled the gift amount and added the number of dollars equal to the boy's age on each subsequent birthday.
Let's break down the calculation step by step:
1. On the first birthday, the uncle gave the boy $1. 2. On the second birthday, the uncle doubled the previous gift amount ($1) and added $2 (the boy's age). So the total gift amount on the second birthday is $1 * 2 + $2 = $4. 3. On the third birthday, the uncle doubled the previous gift amount ($4) and added $3 (the boy's age). So the total gift amount on the third birthday is $4 * 2 + $3 = $11. 4. This pattern continues until the boy's 18th birthday.
To calculate the total amount of money gifted by the boy's 18th birthday, we need to sum up the gift amounts for each birthday from the first to the 18th.
Let's calculate the total:
1. On the first birthday: $1 2. On the second birthday: $4 3. On the third birthday: $11 4. On the fourth birthday: $22 5. On the fifth birthday: $37 6. On the sixth birthday: $58 7. On the seventh birthday: $85 8. On the eighth birthday: $120 9. On the ninth birthday: $163 10. On the tenth birthday: $216 11. On the eleventh birthday: $279 12. On the twelfth birthday: $354 13. On the thirteenth birthday: $443 14. On the fourteenth birthday: $548 15. On the fifteenth birthday: $671 16. On the sixteenth birthday: $814 17. On the seventeenth birthday: $979 18. On the eighteenth birthday: $1,168
To find the total amount of money gifted by the boy's 18th birthday, we sum up the amounts from the first to the eighteenth birthday:
$1 + $4 + $11 + $22 + $37 + $58 + $85 + $120 + $163 + $216 + $279 + $354 + $443 + $548 + $671 + $814 + $979 + $1,168 = $7,476.
Therefore, the total amount of money gifted to the boy by his 18th birthday is $7,476.


Топ вопросов за вчера в категории Информатика







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili