JavaScript code for PE problem 405 added.