Given a number **N**, the task is to find the sum of all the elements from all possible subsets of a set formed by first **N** natural numbers.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a number N as input.

**Output:**

For each test case, print the sum in new line.

**Constraints:**

1 <= T <= 50

1 <= N <= 50

**Example:**

**Input:**

2

2

3

**Output:**

6

24

**Explanation:**

```
Input : n = 2
Output : 6
Possible subsets are {{1}, {2},
{1, 2}}. Sum of elements in subsets
is 1 + 2 + 1 + 2 = 6.
```

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Vagesh Verma | 98 |

UrGuru | 98 |

chaolinyu | 84 |

prernaus24 | 83 |

devendrachoudhary5485 | 74 |

abducodes | 624 |

harshtyagi36 | 298 |

highway_to_hell | 252 |

rajeswarii | 248 |

arpit_anshuman | 240 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.