**Programming** Examples

# Python program to print first ten mersenne numbers

Write Python program to print first ten mersenne numbers. Numbers in the form 2n-1 are called Mersenne numbers.

For example, the first Mersenne number is 21-1=1, the second Mersenne number is 22-1=3 etc.

`Solution`

```
print("First Ten Mersenne numbers are : ")
for n in range(1,11):
num=2**n-1
print(num,end=" ")
```

`Output`

First Ten Mersenne numbers are :

1 3 7 15 31 63 127 255 511 1023