Hello.

Simply I have a C++ algorithm that performs two types of simple computations randomly and consecutively:

or

being "x" the result of the previous computation, example:

- |
- |
- |
- |
- and so on...

The problem is that, after a set of computations, normally the machine gets tired, because the result number grows very fast.

I'm working with very great integers, biggest than (2^1000). To help it I'm trying to work only with notations, but I'm having problems

with the second computation case, id est, "(x*2)-1". For example, I can write: "(((((x*2)*2)*2)*2)*2)*2 = x * 2^6", this means the machine

can handle very great integers only incrementing "1" to the exponent. However, when the second computation case arises, I don't know how to proceed, that is,

I don't know how I can shrink [for instance]: ((((((((((x*2)-1)*2)-1)*2)*2)*2)*2)-1)*2)-1 so that to avoid multiplications like the first case. The problem lies in the randomness of "-1".

Sorry if I'm ignoring something obvious.

Then, there's a way through which I can write "((((((((((x*2)-1)*2)-1)*2)*2)*2)*2)-1)*2)-1" in notation form without having to resort to "brute force"?

Very thanks.