-
-
Save cf/d27eea8e4aca845027bd to your computer and use it in GitHub Desktop.
Zeta function, ζ(x) for all real integers!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//My implementation of Zeta function, will extend to all complex numbers later | |
function GammaReal(n) | |
{ | |
var s=1; | |
for(var i=2;i<n;i++) | |
{ | |
s*=i; | |
} | |
return s; | |
} | |
function ZetaReal(r,n) | |
{ | |
if(r>1) | |
{ | |
var s=0; | |
for(var x=1;x<=n;x++) | |
{ | |
s+=Math.pow(x,-r); | |
} | |
return s; | |
}else{ | |
return 2*Math.pow(2*Math.PI,r-1)*Math.sin(r*Math.PI/2)*GammaReal(1-s)*ZetaReal(1-r,n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment