This is my C source code. Copy it, use it, learn from it, improve on it, enjoy it. Please don't sell it; if you alter it, take my name off of it, so people don't blame me if it screws up. They have been tested on a Macintosh Symantec C 6.0 compiler, and on unix systems with no problems.

Triangles is a program I wrote to find prime pythagorean triples (Integer solutions to the pythagorean theorem, a^2+b^2=c^2). For example, a right triangle with hypotenuse length 5 and the other two sides of length 3 and 4 is a pythagorean triple, because 3^2=9, 4^2=16, 5^2=25, and 9+16=25. Triangles displays only the prime pythagorean triples. For example, it will display 3:4:5, but not 6:8:10 because 6:8:10 is twice 3:4:5.

Phone is pretty simple. It takes the last four digits of a phone # and displays all the letter combinations that the number spells (using the letters on the standard telephone keypad).

Primer and Primer2 were two of my attempts at making a factorizing algorithm. If you're with the NSA, don't worry; these programs could never crack PGP. Primer2 is significantly faster than the original Primer.

[ matt's code page ] [ ! ] [ 1996 Matt Chisholm. All rights reserved. ]