# Mathfun.py 2.1

Software ID: 119819

Mathfun.py 2.1 Description

Mathfun.py project s a rather small Python library that contains some of the more obscure (others would say less useful 8^) mathematical formula/functions that I have always found interesting/amusing. These include primality tests, fibonacci sequences and turning characters into numbers, among other things. The next paragraph includes a little story about my strange habits as a teenager. The paragraph after that contains some ramblings about primes and formulas. The paragraph after that hasnt been decided on yet, but you can be assured that it will be more stream-of- consciousness rambling about something mathematic by yours truly. One of the reasons that this library exists is that, as a junior programmer in high school, I spent an insane amount of time writing BASIC programs on our IIgs that would calculate the first 100 primes or some other such nonsense. I would write it one way, get out a stop watch, run it, record the time it took, rewrite it, rerun it, retime it and calculate the difference as percentage decrease in time. Repeat the previous until you get BASIC that looked like an explosion in a type factory. All in some sort of quest to... well, I dont really know what I was shooting for. I just enjoyed it. Calculating if a number was prime, calculating the prime factorization, calculating the first N prime numbers... Yeah, I was a strange one. But, in retrospect, all that solitary math kinda helped. While I reinvented many a prime wheel, I did it on my own, which was something of a personal fulfillment once I had learned more of a history of mathematics. And I never forgot most of those formulas that I worked out on that Apple. For instance, mathfun.isprime(number) utilizes most of what I learned back in high school. It iterates through the odd numbers, up to the integer value of the square root of the number in question. I still remember the epiphany that I had that I only needed to calculate through the square root of the number. 8^) Theres a minor paradox with the calculation of a prime. The quickest way to generate primes would be to only attempt modular arithmetic with prime numbers. However, to do it that way means that you have to generate a list of prime numbers first, which involves a primality test on every odd number up to the square root of the number in question. This would be sloooooow for the primality test for any single number. (For instance, isprime(10000) would involved roughly 50 full primality tests to generate the list needed to be a maximally efficient test on it.) So, we accept that even if were not going to get any results doing (N mod 9), its much quicker to eat those wasted cycles than to determine if 9 is prime first. However, if youre doing nothing more than simply cranking out prime after prime, it becomes much more efficient to only do the primality test with a list of primes, since (if you start from 2) youve already determined the ealier ones before. (Theres probably a break-even time first (machine dependent) before "determine all primes with primes" becomes more efficient than "crank through the odd numbers".) Its easy to see however, that for very large numbers its much better to only work with primes. Theres also a minor question of the speed of the data structures used to store the prime list versus the very fast next odd number test. However, Ill leave that one up to the True Computer Scientists.

AWinstall
AWinstall is a professional, efficient and easy-to-use setup builder for creating compact and intelligent setups for your Win32 and .NET applications. A modern user interface, help and wizards allow you to create professional setups in minutes.
OxyProject Metrics
OxyProject Metrics is an application that provides code metrics for software projects empowering software professionals to assess the complexity and maturity of a software product.
Syncro SVN Client
Syncro SVN Client is a cross platform application supporting all range of Subversion operations, in a very productive user interface.
Quick.Forum - freeware and fast message board
Freeware, fast, simple, and multilingual message board.
OxyGen Code Generator
Outputs include SQL Statements, Data Access Layer classes, Caching and Domain Model classes. The Business Layer is exposed through WCF, XML Web Services and ASP.NET. Searching, Paging Table Inheritance included.
Share Multiple Messages On Facebook Script
Pacestar UML Diagrammer
Pacestar UML Diagrammer helps you to quickly and easily generate all varieties of UML2 diagrams. Develop, document, and communicate your designs in a systematic yet flexible AND commonly understood notation.
Barcode Professional for WPF
Barcode for WPF .NET. High quality vector-based Linear, Postal and 2D Symbologies. Visual Studio support. WPF data-binding support. Crystal Reports .NET Support. Save barcode images in image files. XML Paper Specification (XPS).
Just BASIC
Just BASIC is a free personal Windows programming tool and tutorial. Great for teaching or learning programming. Create utilities, games, business apps with syntax coloring editor, debugger, GUI editor. Produces standalone applications.
IntegralUI TreeView
With IntegralUI TreeView you can create rich hierarchical presentation of your data. Use XML tags to fill the tree node content with text in multiple colors and paragraghs, images, custom controls, checkbox, flag and hyperlinks.
Gantt Chart Library 2.0
Gantt Chart Library 2.0 contains Gantt Chart related previous version Windows client components, such as the GanttChartView, and ResourceLoadChartView controls.