

A program to approximate pi using Monte-Carlo methods.A program that prints the partitions of a number.A program that inputs a number and a counting interval and prints the Ring of Josephus.Fraction math has some related programs.A program that computes the 'osculator' for a prime number and uses it to test an input number for divisibility by that prime.A program that prints the sum of the numbers from 1 to n.A program that prints an addition table.A program that computes a factorial using recursion.A program that uses the Euclidean Algorithm to print the gcd of two numbers.A program that reads a list of numbers from a file and prints their factors.A program that generates a list of prime numbers and prints the results to a file.

A program that sums the numbers in a list (NEW), mean, square mean, standard deviation.Can you help write one of them? I think the goal is to show how to use a programming language to solve a problem, as opposed to a demonstration of efficient algorithms, so don't worry too much about tuning for optimum performance. Here is a list of simple programs that he would like to see. (Note that Linux users might have to type tclsh to get a particular version of tclsh, like tclsh8.0.) Linux users should be able to save the code to a file, then use the command tclsh filename to run the program. He writes I think the reason I can't find anything like this is that it is TOO simple.Įach program should be a complete sample script. Prevett, a Mathematics Instructor at Cochise College in Sierra Vista Arizona (US) posted a request on the seul-edu mailing list ( ) asking for program examples. These sample math programs are REALLY simple examples of using programming to solve math problems. A program to compute pi using Monte-Carlo methods.A program that prints the partitions of a number.A program that prints the Ring of Josephus.A program that computes the osculator for a prime number, and uses it to test an input number for divisibility by that prime.A program that computes the sum of the numbers from 1 to n.A program that inputs b,n, and p and prints b^n mod p for n=1 to n-1.A program that prints the sum of two squares.A program that prints a multiplication table mod n.A program that prints a multiplication table.A program displaying any expression table (wish version).A program that prints some mathematical operation tables!.A program that computes a factorial using recursion*.A program that uses the Euclidean Algorithm to print the GCD (greatest common divisor) of two numbers.A program that reads a list of numbers from a file and prints their factors.A program that sums the numbers in a list.A program that does a loop and prints the numbers from 1 to 10.
