2

Newly, there was a solution found for the following equation in integers:

x^3 + y^3 + z^3 = 33

Namely, it holds for x = 8866128975287528, y= -8778405442862239, and z=-2736111468807040

If I check it in Python, it's fine:

>>> (8866128975287528)**3 - (8778405442862239)**3 - (2736111468807040)**3
33L

However, in R it doesn't work:

8866128975287528^3 - 8778405442862239^3 - 2736111468807040^3
[1] -2.535301e+30

Why?

Max Li
  • 5,069
  • 3
  • 23
  • 35

2 Answers2

4

The biggest number with 32 bit is 2,147,483,647. You have to use special libraries. You can use the library(opennssl) with the function bignum().

library(openssl)
bignum(8866128975287528)^3 - bignum(8778405442862239)^3 - bignum(2736111468807040)^3

> 33
J_F
  • 9,956
  • 2
  • 31
  • 55
2

R uses 32-bit integers, which means the largest integer R can hold is around 2 billion. You can use the package int64 to try to get around this. See this question for more information.

Nathaniel
  • 3,230
  • 11
  • 18