Ramanujan | R Documentation |
Finds all the numbers <= Nmax
that can be expressed as a sum of two
positive integer cubes in at least k
distinct ways.
Ramanujan(Nmax, k=2)
Nmax |
Limit the search to numbers <= |
k |
Number of distinct ways the returned numbers can be expressed as a sum of two positive integer cubes. |
A data frame with columns N
, n1
, and n2
.
Columns n1
and n2
show the decomposition of N
as
the sum of two positive integer cubes i.e. they are such that
n1^3 + n2^3 == N
.
Hervé Pagès
https://en.wikipedia.org/wiki/1729_(number)
https://en.wikipedia.org/wiki/Taxicab_number
## Find numbers <= 2e4 expressible as the sum of two cubes
## in 2 distinct ways:
Ramanujan(Nmax=2e4, k=2)
## Find numbers <= 2e8 expressible as the sum of two cubes
## in 3 distinct ways:
Ramanujan(Nmax=2e8, k=3)
## Ramanujan(1e13, k=4) will find the 4th taxicab number
## (6963472309248, denoted Ta(4)) in < 30s on a machine
## with enough RAM (it uses about 12.5Gb of memory):
## Not run:
Ramanujan(1e13, k=4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.