A Euler Brick is a cuboid where the length of all the edges are integers and all of the diagonals of the faces are integers as well. All sides must also be different.
Your program has to find as many different Euler Bricks where the sides are less than L within the time M (L and M will be defined later).
All of your calculated bricks have to be unique. This means that if your dimensions are the same, just in a different order, it must not be counted.
To calculate a brick means to find the lengths of the edges and the lengths of the diagonals of the faces of a valid Euler Brick.
Your bricks must also be indivisible by each other. In the same way that the Pythagorean triplet
6, 8, 10 is divisible by
3, 4, 5, your bricks must not be divisible by each other.
To test your program, I will need to the following:
- The language your code is written in
- A command to run your code
- Your code
Your score will be the average number of bricks your program calculates (running the program five times). To do this, I will run your program and end it after M minutes have elapsed. Once you have submitted your answer, I will add a comment on your answer telling what your score is. If you make an edit to your code, please notify me directly so I can find your score again.
For that reason, I need your program to print the number of bricks either at throughout the running or at the end. This can be done like so (in Python it would help if people told me how to do this in other languages for this example):
try: # Calculation goes here except KeyboardInterrupt: # I will use Ctrl-C print(numberofbricks) exit()
For this challenge
M=2 minutes. In the event of a tie, the actual time taken to calculate all of the bricks will be used. The lower time wins.
I will find your time using the script below. All programs will be tested on the same machine.
import time, subprocess command = # How do you run your program? s=time.time() subprocess.Popen(command, shell=True) e=time.time() print(e-s)
1. Peter Taylor - 5731679685.5 bricks per minute 2. Steve Verrill - 680262303 bricks per minute 3. Beta Decay - 0.5 bricks per minute