Let's $N$ be a positive integer and $P$ - set of all possible partitions of the $N$, where $p = (a_1,a_2,...,a_n)$ with $a_1\le a_2 \le ... \le a_n$ and $a_1+a_2+...+a_n = N$. Let's $A$ be the number of partitions $p \in P: \dfrac{\max\{p\}}{\min\{p\}}<2$. How do I find the $A$?
Input: $N \in \Bbb N$. Output: $A$ - the number of partitions $p \in P: \dfrac{\max\{p\}}{\min\{p\}}<2$.
I think that this problem can be solved by a dynamic-based algorithm, but I didn't figure it out. Thanks in advance for your reply.