Show HN: Math Puzzle
let printN = (maxN) => {
let nextVal = (x,n) => {
let b2 = new Big(2);
let val = b2.pow(n).mul(3).mul(b2.minus(x).sqrt());
console.log(val.toString());
return x.plus(2).sqrt();
};
let s = (new Big(3)).sqrt().plus(2).sqrt();
for (let n=2; n<maxN; n++) {
Big.DP = n + 10;
s = nextVal(s,n); }
};
printN(500);
[1] Big decimal: https://raw.githubusercontent.com/MikeMcl/big.js/master/big.min.js[2] Try on JSFiddle: https://jsfiddle.net/asgxL84y/
[3] The math: https://pasteboard.co/JeNGeB0.png
No comments yet.