• + 0 comments

    Check this out via javascript

    const adSpam = (n) => {
        let cumulative = 0;
        let shared = 5;
        let liked = 0;
        for (let i = 1; i <= n; i++) {
            liked = Math.floor(shared / 2)
            shared = liked * 3
            cumulative += liked
        }
    
        return cumulative;
    }
    
    console.log(adSpam(3))