Decompose a number `num` into an array (tuple in Haskell, array of arrays `long[][]` in C# or Java) of the form `[[k1,k2,k3...], r]`,  `([k1,k2,k3...], r)` in Haskell, `[[k1,k2,k3...], [r]]` in C# or Java) such that:

1. each kn is more than one
2. eack kn is maximized (first maximizing for 2 then 3 then 4 and so on)
3. and 2^(k1) + 3^(k2) + 4^(k3) + ... + n^(kn-1) + r = num


##Examples
```
# when there are no `k` more than 1:

3 

[[], 3] = 

3

# when the remainder is zero:

8330475

[[22, 13, 10, 8, 7, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2], 0] = 

2 ^ 22 + 3 ^ 13 + 4 ^ 10 + 5 ^ 8 + 6 ^ 7 + 7 ^ 6 + 8 ^ 6 + 9 ^ 5 + 10 ^ 5 + 11 ^ 5 + 12 ^ 4 + 13 ^ 4 + 14 ^ 4 + 15 ^ 3 + 16 ^ 3 + 17 ^ 3 + 18 ^ 3 + 19 ^ 3 + 20 ^ 3 + 21 ^ 2 + 22 ^ 2 + 23 ^ 2 + 24 ^ 2 + 0 = 8330475

# when there is both `k` and a remainder:

26 

[[4, 2], 1] = 

2 ^ 4 + 3 ^ 2 + 1 = 26

# when there is neither `k` nor a remainder:

0

[[], 0] = 

0
```

As allways any feedback would be much appreciated

Source: codewars | Difficulty: EASY

Starter code: def decompose(num):
	

Solutions:
from math import log

def decompose(n):
	i = 2
	result = []
	while n >= i * i:
		k = int(log(n, i))
		result.append(k)
		n -= i ** k
		i += 1
	return [result, n]


from math import log

def decompose(num):
	(i, res) = (2, [])
	while i ** 2 <= num:
		n = int(log(num, i))
		res.append(n)
		num -= i ** n
		i += 1
	return [res, num]


from itertools import count
from math import log

def decompose(num):
	result = []
	for x in count(2):
		if num < x * x:
			return [result, num]
		result.append(int(log(num, x)))
		num -= x ** result[-1]


from math import log

def decompose(a):
	(li, i) = ([], 2)
	while i ** 2 <= a:
		li.append(int(log(a, i)))
		a -= i ** li[-1]
		i += 1
	return [li] + [a]


from math import log

def decompose(num):
	ns = []
	for i in range(2, 100):
		j = int(log(num or 1, i))
		if j <= 1:
			break
		ns.append(j)
		num -= i ** j
	return [ns, num]


from math import log

def decompose(num):
	(k, ks) = (2, [])
	while num:
		p = int(log(num, k))
		if p < 2:
			break
		ks.append(p)
		(num, k) = (num - k ** p, k + 1)
	return [ks, num]


def decompose(num):
	from math import log
	t = 2
	ks = []
	while num ** 0.5 >= t:
		k = int(log(num, t))
		num -= t ** k
		ks.append(k)
		t += 1
	return [ks, num]


from math import log
decompose = d = lambda n, k=[], i=2: n < i * i and [k, n] or d(n - i ** int(log(n, i)), k + [log(n, i) // 1], i + 1)


from itertools import count
from math import log

def decompose(n):
	r = []
	for x in count(2):
		if x > n:
			break
		m = int(log(n, x))
		if m == 1:
			break
		r.append(m)
		n -= x ** m
	return [r, n]