# Task
 Suppose there are `n` people standing in a circle and they are numbered 1 through n in order. 
 
 Person 1 starts off with a sword and kills person 2. He then passes the sword to the next person still standing, in this case person 3. Person 3 then uses the sword to kill person 4, and passes it to person 5. This pattern continues around and around the circle until just one person remains.

 What is the number of this person? 

# Example: 

 For `n = 5`, the result should be `3`.
```
1 kills 2, passes to 3.
3 kills 4, passes to 5.
5 kills 1, passes to 3.
3 kills 5 and wins.```

# Input/Output


 - `[input]` integer `n`

  The number of people. 1 through n standing in a circle.
  
  `1 <= n <= 1e9`
  
  
 - `[output]` an integer

  The index of the last person standing.

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

Starter code: def circle_slash(n):
	

Solutions:
def circle_slash(n):
	return int(bin(n)[3:] + '1', 2)


from math import log

def circle_slash(n):
	return 2 * (n - 2 ** int(log(n, 2))) + 1


from math import log2

def circle_slash(n):
	m = 2 ** int(log2(n))
	return n % m * 2 + 1


def circle_slash(n):
	return int('{:b}'.format(n)[1:] + '1', 2)


def circle_slash(n):
	return (n & ~(1 << n.bit_length() - 1)) << 1 | 1


def circle_slash(n):
	if n & n - 1 == 0:
		return 1
	result = 1
	while result < n:
		result = result << 1
	return (n - result / 2) * 2 + 1


circle_slash = lambda n: int(bin(n)[3:] + '1', 2)


def circle_slash(n):
	s = format(n, 'b')
	return int(s[1:] + s[0], 2)


from math import log2

def circle_slash(n):
	b = 2 ** int(log2(n))
	return (n - b) * 2 + 1