simple log solution
Code

# Code
```typescript []
function smallestNumber(n: number): number {
    const log2 = Math.log2(n + 1);
    const log2C = Math.ceil(log2)
    return Math.pow(2, log2C) - 1
};
```
['TypeScript']