Код на Python:
from itertools import combinations_with_replacement as comb
n = int (input())
def func (a):
global n
if a == n:
return 1
else:
return 0
a = list(range(1, n+1))
count = 0
for i in range (1, n+1):
y = sum(map (func, map(sum, comb (a, i
count += y
print (count)
Объяснение: