var num =153;
Last = 0;
sum=0;
while(num>0)
{
    var n = num%10;
    last= Last+n;
    sum= sum+(last*last*last);
    num = Math.floor(num/10);
    
    
}
console.log(sum);

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: