# Task
 Lonerz got some crazy growing plants and he wants to grow them nice and well.
 
 Initially, the garden is completely barren. 
 
 Each morning, Lonerz can put any number of plants into the garden to grow. 
 
 And at night, each plant mutates into two plants. 
 
 Lonerz really hopes to see `n` plants in his garden.

 Your task is to find the minimum number of plants Lonerz has to plant to get `n` plants one day.

# Example

 For `n = 5`, the output should be `2`.
 
 Lonerz hopes to see `5` plants. He adds `1` plant on the first morning and on the third morning there would be `4` plants in the garden. He then adds `1` more and sees `5` plants. 
 
 So, Lonerz only needs to add 2 plants to his garden.
 
 For `n = 8,` the output should be `1`.
 
 Lonerz hopes to see `8` plants. Thus, he just needs to add `1` plant in the beginning and wait for it to double till 8.
 
# Input/Output

 The number of plant lonerz hopes to see in his garden.
 
 
 - `[input]` integer `n`
 
   `1 <= n <= 10^7`


 - `[output]` an integer

 The number of plants Lonerz needs to plant.

Source: codewars | Difficulty: EASY
Tags: Ad-hoc

Starter code: def plant_doubling(n):
	

Solutions:
def plant_doubling(n):
	return bin(n).count('1')


def plant_doubling(n):
	p = 0
	while n:
		if n % 2 == 1:
			n -= 1
			p += 1
		n //= 2
	return p


import math

def plant_doubling(n):
	times = 0
	while n != 0:
		times += 1
		n = n - 2 ** int(math.log(n, 2))
	return times


def plant_doubling(n):
	return sum((c == '1' for c in bin(n)[2:]))


def plant_doubling(n):
	powers = [2 ** i for i in range(30)]
	powers.reverse()
	difference = n
	array = []
	for i in range(30):
		if powers[i] <= difference:
			difference = difference - powers[i]
			array.append(powers[i])
	return len(array)


def plant_doubling(n):
	schemat = str(bin(n))
	return sum((int(schemat[i]) for i in range(2, len(schemat))))


def plant_doubling(n):
	s = 0
	while n:
		if n % 2:
			s += 1
		n //= 2
	return s


def plant_doubling(n):
	list = []
	for i in range(64):
		list.append(2 ** i)
	rounds = 0
	while n >= 1:
		relevant_list = []
		for item in list:
			if item <= n:
				relevant_list.append(item)
		n = n - relevant_list[-1]
		rounds = rounds + 1
	return rounds