Saw recently on page the message on operation with an array where all information on number when it is considered is stored!, also I can not find.
From its part I will try to make simple algorithm by the same principle.
The task: to find numbers for 2 in level N for any N.
There is number Q which defines a level of sharing of number on groups, for example Q=10000000000. (10 in 10th level)
There is array (), 1 <=j <=K. P (1 =1. We admit To = 10. Any more did not meet.
1 <=i <=N,
1 <=j <=K.
If P (j)> 0 that P (j) = P (j) x 2
If P (j)> =Q that (P (j) =P (j)-Q, P (j+1) =P (j+1) +1)
Then the number will look as total P (j) (Q in a level (j-1))
There can be a case, when after addition 1 all P (j)> = Q.
Then a cycle
If P (j+1)> =Q that (P (j+1) =P (j+1)-Q, P (j+2) =P (j+2) +1) etc. with loop termination if <Q.