| Download
Prime Decomposition of Sum of Three Cubes for 33
Project: Algorithms
Path: sumOfThreeCubes.ipynb
Views: 260Kernel: Python 3 (system-wide)
In [ ]:
Resources
In [2]:
33
In [3]:
This seems faster thant the following sieve
Just brute force output the list of primes that divide each number.
In [4]:
In [34]:
In [22]:
({2: 3, 7: 1, 467: 1, 378289: 1, 896201: 1},
{8778405442862239: 1},
{2: 7, 5: 1, 89917: 1, 47545783: 1})
Prime sieve
This is the original code
In [ ]:
Prime sieve
This is a variant of the above that only looks for prime factors of x, if x = 0 it runs as the above.
In [93]:
In [ ]:
In [ ]:
The following is just for a check
In [ ]:
In [ ]:
In [94]:
In [98]:
In [15]:
'a'
In [16]:
{'a': 'a'}
In [ ]: