# Task
 The sequence of `Chando` is an infinite sequence of all Chando's numbers in ascending order.

 A number is called `Chando's` if it is an integer that can be represented as a sum of different positive integer powers of 5.

 The first Chando's numbers is 5 (5^1). And the following nth Chando's numbers are:
 ```
 25  (5^2)
 30  (5^1 + 5^2)
 125 (5^3)
 130 (5^1 + 5^3)
 150 (5^2 + 5^3)
 ...
 ...
 ```

 Your task is to find the Chando's nth number for a given `n`.

# Input/Output


 - `[input]` integer `n`

  `1 <= n <= 7000`


 - `[output]` an integer

  nth Chando's number

Difficulty: introductory

Starter code:

def nth_chandos_number(n):
	

Solutions:
def nth_chandos_number(n):
    return int((bin(n)+"0")[2:], 5)

from itertools import combinations, chain
from math import log
def nth_chandos_number(n):
    l = [0] + [5 ** i for i in range(1, int(log(n, 5)) + 10)]
    m = chain(*[combinations(l, ni) for ni in range(1, len(l) + 1)])
    ls = sorted(list(set([sum(i) for i in m])))
    return ls[n]


""" Considering that we search first 7000 Chandos numbers, generate the full
    list and then returned the good one on each call.
    
    Process: Chandos number are made of 5^n terms with DIFFERENT n, so integers
             usable as power can be represented in a binary way:
             
                 0    =>    no Chandos
                 1    =>    first Chandos: 5^1
                 10   =>    secund:        5^2
                 11   =>    ...            5^2 + 5^1
                 ...
             
             This way, the ARCHIVE is made by iterating binary numbers up to 7000
             in base 10.
             For the simplicity of the implementation, the binary representation is 
             reversed (-> big endian notation : this avoid the need of filling the 
             binary string representation with leading 0).
"""

ARCHIVE = [ sum( 5**(i+1) for i,s in enumerate(reversed(bin(n)[2:])) if s == '1' ) for n in range(1, 7001) ]

def nth_chandos_number(n): return ARCHIVE[n-1]

from itertools import combinations as c
def nth_chandos_number(n):
    comb, generate, i = [1], [], 1
    while len(generate) <= n:
        generate.extend(sorted([j for k in range(1,len(comb)+1) for j in c(comb,k) if j[0]==i]))
        i += 1  ; comb.insert(0, i)
    return sum(5 ** i for i in generate[n-1])

nth_chandos_number=c=lambda n:n and c(n//2)*5+n%2*5

lst = [5]
for i in range(2, 14):
    x = 5**i
    lst.append(x)
    temp = lst[:]
    for j in temp[:-1]:
        lst.append(j+x)

def nth_chandos_number(n):
    return lst[n-1]

def nth_chandos_number(n):
    return int(bin(n)[2:] + '0', 5)

def nth_chandos_number(n):  # :( stupid code
    a, i, j, m = [], -1, 1, 5
    while len(a) < n:
        m = 5 ** j
        a.append(m)
        while j > 1 and i < 2 ** ~-j-1:
            a.append(m + a[i])
            i += 1
        i, j = 0, j+1
    return a[~-n]

def nth_chandos_number(n):
    b='{:b}'.format(n)
    r=0
    for d in b:
        r=r*5+int(d)*5
    return r

def nth_chandos_number(n):
    t, ans = 1, 0
    while n:
        t *= 5
        if n % 2:
            ans += t
        n //= 2
    return ans