def decompose_number_on_base(number, base):
	"""
	Returns a number's decomposition on a defined base

	:param number: The number to decompose
	:param base: list representing the base. It must be sorted and
	each element must be a multiple of its predecessor. First element
	must be 1.
	:raises TypeError: if base is invalid
	"""
	_base = list(base)
	try:
		assert(_base[0] == 1)
		for i in range(1, len(_base)):
			assert(_base[i] > _base[i-1])
			ratio = float(_base[i]) / float(_base[i-1])
			assert(ratio == int(ratio))
	except AssertionError:
		raise TypeError("Base (%s) is invalid"%_base)

	_base.reverse()
	output = [0]*len(_base)
	for base_index in range(len(_base)):
		r = number % _base[base_index]
		output[base_index] = int((number-r)/_base[base_index])
		number = r

	output.reverse()
	return output