Skip to content

Instantly share code, notes, and snippets.

View dbatis's full-sized avatar

Dimitris Batis dbatis

View GitHub Profile
__author__ = 'dbatis'
def hardyRamanujan(upperLimit):
"""
Computes all cases of x^3 + y^3 = z^3 + g^3, where x <> y <> z <> g and x, y, z, g < upperLimit.
Example output:
>>> hardyRamanujan(20)
[[(1, 12, 1729), (9, 10, 1729)], [(2, 16, 4104), (9, 15, 4104)]]