#########################################################
#                                                       #
#    Coded by Indranil Ghosh (indranilg49@gmail.com)    #     
#                                                       #
#########################################################

#Python 2.7.11, OEIS sequence: A005751

#Using memoization process: https://stackoverflow.com/questions/1988804/what-is-memoization-and-how-can-i-use-it-in-python

from sympy import divisors
class Memoize:
    def __init__(self, func): 
        self.func = func
        self.cache = {}
    def __call__(self, arg):
        if arg not in self.cache: 
            self.cache[arg] = self.func(arg)
        return self.cache[arg]
@Memoize
def r2(n): return 1 if n==1 else 2/(n - 1)*sum([r2(m)*sum([d*r2(d) for d in divisors(n - m)]) for m in xrange(1, n)])
def p2(n): return 1 if n==1 else 1/(n - 1)*sum([p2(m)*sum([d*r2(d) for d in divisors(n - m)]) for m in xrange(1, n)])
def m2(n): return (r2(n) - sum([r2(m)*r2(n - m) for m in xrange(1, n)]) + (r2(n/2) if n%2==0 else p2((n + 1)/2)))/2
print map(m2, xrange(1, 31))