Grains

in ita •  2 months ago 

export const square = (num) => {
if(num<=0 || num > 64) throw new Error('square must be between 1 and 64');
return 2n**BigInt(num-1);
};

export const total = () => {
let result = 0n;
for(let i=0; i<64; i++){
result += 2n**BigInt(i);
}
return result;
};

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!