from operator import mul

from sympy import primepi, primefactors

from sympy.ntheory.factor_ import core

def a055396(n): return 0 if n==1 else primepi(min(primefactors(n)))

def a032742(n): return 1 if n==1 else n/min(primefactors(n))

def a048675(n): return 0 if n==1 else 2**(a055396(n) - 1) + a048675(a032742(n))

def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))

def a285328(n):
    if core(n) == n: return 1
    r = a007947(n)
    k = n - r
    while k>0:
        if a007947(k) == r: return k
        else: k-=r

def a(n):
    if n<3: return n - 1
    if core(n) == n: return 2*a(a048675(n))
    else: return 1 + 2*a(a285328(n))

print [a(n) for n in xrange(1, 38)]