[manual index][section index]


ack, crackerbarrel, factor, fibonacci, fit, genprimes, mersenne, parts, perms, pi, powers, primes, sieve - miscellaneous mathematical applications


math/ack [ m ] [ n ]
math/crackerbarrel [ n ]
math/factor [ n ]
math/fit [ -ddeg ] [ -v ] [ file ]
math/genprimes [ lim ]
math/mersenne [ num ]
math/parts [ -a ] [ num... ]
math/perms [ n ]
math/pi [ dp ]
math/powers [ -p num ] [ -n num ] [ -f num ] [ -l num ] [ -m num ] [ -v ]
math/primes [ m ] [ n ]
math/sieve [ -a alg ] [ lim ]


A collection of simple mathematical utilities.

Calculates and times Ackermann's function A(m, n).
Solves the crackerbarrel puzzle n times and outputs the time taken. See the source for details of the puzzle.
Factors the number n.
Generates the first few terms of the Fibonacci series using recursion and user defined exceptions.
Fits a polynomial of degree deg to a set of points (x, y) where x is the independent variable, y the dependent one. All x and y values should be seperated by white space and can be real or integer. The values are read from file or standard input if none is given. The -v option prints a table of actual and expected y values.
Generates primes numbers up to and including lim using spawned processes and buffered channels.
Tests the primality of the Mersenne numbers ie numbers of the form 2^n-1. The argument num is the power of 2 in the above.
Calculates the number of partitions of the given number(s). The -a option will print out a table of the number of partitions of all numbers up to the given number(s).
Prints out all permutations of n elements.
Calculates the value of pi to dp decimal places.
Investigates the number of representations of an integer as a sum of powers. The -p option denotes the power of use (default 2). The -n option denotes the number of powers to sum (default 2). The -f option denotes the minimum number of such representations found before reporting them (default 2). The -l and -m options denote the smallest and largest numbers to consider respectively (defaults 0 and 8192). Finally the -v option prints various statistics during the search.
Prints out all primes between m and n .
Prints out prime numbers up to lim using a sieve algorithm. The -a option indicates the level of sophistication of the algorithm (0-4).


	math/powers -p 3 -m 30000
	[2] 1729 = 1**3 + 12**3 = 9**3 + 10**3
	[2] 4104 = 2**3 + 16**3 = 9**3 + 15**3
	[2] 20683 = 10**3 + 27**3 = 19**3 + 24**3
The number of representations found for each integer is indicated in
square brackets.



MATH-MISC(1 ) Rev:  Tue Mar 31 02:42:38 GMT 2015