JavaScript code for PE problem 259 added.