You are viewing a single comment's thread. Return to all comments →
You have to find a K which maximizes
P(K) = (N/K)^K
You can optimize over the real numbers and then choose the best whole number.
I would suggest to plot P(K) and the K-choice of your formula for some N and K values, among them the examples, to get it right.
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #183: Maximum product of parts
You are viewing a single comment's thread. Return to all comments →
You have to find a K which maximizes
P(K) = (N/K)^K
You can optimize over the real numbers and then choose the best whole number.
I would suggest to plot P(K) and the K-choice of your formula for some N and K values, among them the examples, to get it right.