The beginnings of a folder containing functions used in Number Theory.

p

Computes the number of partitions of n. (See http://en.wikipedia.org/wiki/Partition_(number_theory).)

A BigInt result is returned. Be prepared for long compute times if you get into 4-digit integers as your input.

This is a JavaScript adaptation of original Java code copyrighted 2002 by Henry Bottomley (http://www.btinternet.com/~se16/js/partitions.htm)

Can someone implement the new (2011) method by Ken Ono et al.? (http://esciencecommons.blogspot.com/2011/01/new-theories-reveal-nature-of-numbers.html)

Examples:

p(4) = 5

p(100) = 190569292