You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Let S_(m) = (x_(1), x_(2), ... , x_(m)) be the m-tuple of positive real numbers with x_(1) + x_(2) + ... + x_(m) = m for which P_(m) = x_(1) * x_(2)^(2) * ... * x_(m)^(m) is maximised.
#
# For example, it can be verified that [P_(10)] = 4112 ([ ] is the integer part function).
#
# Find Σ[P_(m)] for 2 ≤ m ≤ 15.
require 'common'
def proportion(k)
#it can be shown (e.g. with Lagrange multipliers) that in the optimal solution we have: