Skip to content

Instantly share code, notes, and snippets.

@peteketcham
peteketcham / pe_596_2.py
Created March 9, 2023 01:48
multiprocess brute force 596
#!/usr/bin/env python3
"""
Project Euler, Problem 596
https://projecteuler.net/problem=596
Let be T(r) the number of integer quadruplets x, y, z, t such that x**2 + y**2 + z**2 + t**2 ≤ r**2.
In other words, T(r) is the number of lattice points in the four-dimensional hyperball of radius r.
You are given that T(2) = 89, T(5) = 3121, T(100) = 493490641 and T(10**4) = 49348022079085897.
#!/usr/bin/env python3
"""
Project Euler, Problem 596
https://projecteuler.net/problem=596
Let be T(r) the number of integer quadruplets x, y, z, t such that x**2 + y**2 + z**2 + t**2 ≤ r**2.
In other words, T(r) is the number of lattice points in the four-dimensional hyperball of radius r.
You are given that T(2) = 89, T(5) = 3121, T(100) = 493490641 and T(10**4) = 49348022079085897.
@peteketcham
peteketcham / gist:80c7a25376553c13c32a849f90cbe302
Created October 19, 2016 20:55
peteketcham Keybase.io proof
### Keybase proof
I hereby claim:
* I am peteketcham on github.
* I am peteketcham (https://keybase.io/peteketcham) on keybase.
* I have a public key whose fingerprint is 2D4B A379 BC61 A7A7 4215 703E 4B42 171A F8C4 CAD9
To claim this, I am signing this object: