I'm trying to create python analogue of wolframalpha's PartitionsQ function which calculates number of distinct partitions of integer. I found documentation about this function http://mathworld.wolfram.com/PartitionFunctionQ.html with some formulas and trying to convert them into code.

Would be:
def distinct_partitions_number(n):
return (sum([
(s(k) - 2 * s(k / 2)) * distinct_partitions_number(n - k)
for k in range(1, n + 1)
])) / n
but s is described by these formulas:
And how can s(n) depend on s(n). What doesn't it mean?


$\sigma_1(n)$ is the described on that page as the sum of the odd divisors of $n$.
$s(n)$ does not refer to itself. It's a bit unfortunate, but the $s$ inside the definition of $\sigma_1$ refers to the divisor sum.