reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
def b(n, i, p): return f(p)**2 if n==0 else 0 if i<1 else sum([b(n - i*j, i - 1, p + j)//f(j)**2 for j in range(n//i + 1)])
print map([a, (n) for n in range(36)]) # Indranil Ghosh, Aug 18 2017, after Maple code
approved
editing
print map(a, xrangerange(36)) # Indranil Ghosh, Aug 18 2017, after Maple code
def b(n, i, p): return f(p)**2 if n==0 else 0 if i<1 else sum([b(n - i*j, i - 1, p + j)/f(j)**2 for j in xrangerange(n/i + 1)])
proposed
approved
editing
proposed
(Python)
from sympy.core.cache import cacheit
from sympy import factorial as f
@cacheit
def b(n, i, p): return f(p)**2 if n==0 else 0 if i<1 else sum([b(n - i*j, i - 1, p + j)/f(j)**2 for j in xrange(n/i + 1)])
def a(n): return b(n, n, 0)
print map(a, xrange(36)) # Indranil Ghosh, Aug 18 2017, after Maple code
approved
editing
proposed
approved