Odd Triangle Sum
Odd numbers can be arranged as a triangle: one number in the first row, two in the second, three in the third, and so on. Write a function row_sum_odd_numbers that takes a row number n and returns the sum of the numbers in that row. Row numbering starts from 1.
Примеры
Ввод
1Вывод
1Ввод
2Вывод
8Ввод
13Вывод
2197Нужно реализовать
def row_sum_odd_numbers(n: int) -> int:
Теги
math
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterVisible tests
1
Input
1Expected
12
Input
2Expected
83
Input
13Expected
21974
Input
19Expected
68595
Input
41Expected
689216
Input
0Expected
0Focus radio
Paused · SomaFM · Fluid