You can purchase a 24-core license for a server with 20 cores, as licensing typically allows you to license more cores than you have physically installed. However, you must ensure that you comply with the licensing terms, which generally require you to activate licenses for all physical cores present. In your case, you would be able to activate only 20 out of the 24 cores, but it's important to check the specific licensing agreement to ensure compliance and avoid any potential issues.
References: