Doing Math With JavaScript
This section of the JavaScripter.net website contains
• JavaScript calculators for prime factorization, arithmetic functions, etc.
• Short math essays (here JavaScript & the browser may be used as computation tools)
• Code examples and notes on various aspects of JavaScript math.
(See also the JavaScript Numbers FAQ for more information.)
Number theory and arithmetic functions:
divisors d(n), sum of divisors σ(n), totient φ(n), prime factorization
• Prime factors calculator (up to 20 digits)
• Euler's totient function φ(n) (up to 20 digits)
• Divisors calculator: σ(n) and d(n) (up to 20 digits)
• Highly composite numbers (up to 20 digits)
• Big integer calculator: arbitrary precision arithmetic (10000+ digits)
Primes
• Trial division primality tests (in JavaScript FAQ section)
• The MillerRabin primality test
• Firoozbakht conjecture:
(p_{k})^{k+1} > (p_{k+1})^{k}
• Generalized Legendre conjecture:
Is there a prime between n^{s} and (n+1)^{s} for s < 2?
• Primes between squares:
How many primes are there between n^{2} and (n+1)^{2}?
• Primes between cubes:
How many primes are there between n^{3} and (n+1)^{3}?
• StrongerthanGoldbach conjecture:
Large even numbers are sums of prime twins!?
Prime constellations or ktuples
• Maximal gaps between prime ktuples:
g_{k}(p) < M_{k} log^{k+1}p.
• Prime Twins
• Prime Quadruplets
• Prime Sextuplets
Probability and statistics
• Maximal intervals between rare random events
• Maximal gaps between Cramer's random primes
Miscellaneous calculators
• City Distance Calculator
More on factorization
• Factorization of numbers up to 9007199254740992 = 2^{53}
• Finding the least factor in integers under 10^{20} (to be published soon)
