numtheory(3tcl)


NAME

   math::numtheory - Number Theory

SYNOPSIS

   package require Tcl  ?8.5?

   package require math::numtheory  ?1.0?

   math::numtheory::isprime N ?option value ...?

______________________________________________________________________________

DESCRIPTION

   This  package  is  for  collecting various number-theoretic operations,
   though at the moment it  only  provides  that  of  testing  whether  an
   integer is a prime.

   math::numtheory::isprime N ?option value ...?
          The  isprime  command  tests  whether  the integer N is a prime,
          returning a boolean true value for prime N and a  boolean  false
          value  for non-prime N. The formal definition of prime' used is
          the conventional, that the number being tested is greater than 1
          and only has trivial divisors.

          To  be precise, the return value is one of 0 (if N is definitely
          not a prime), 1 (if N is definitely a prime), and on  (if  N  is
          probably  prime);  the  latter two are both boolean true values.
          The case that an integer may be classified as  "probably  prime"
          arises  because  the  Miller-Rabin  algorithm  used  in the test
          implementation is basically probabilistic, and  may  if  we  are
          unlucky  fail  to  detect  that  a  number is in fact composite.
          Options may be used to select the risk of such "false positives"
          in  the test. 1 is returned for "small" N (which currently means
          N < 118670087467), where it is known that no false positives are
          possible.

          The only option currently defined is:

          -randommr repetitions
                 which  controls  how  many  times  the  Miller-Rabin test
                 should be  repeated  with  randomly  chosen  bases.  Each
                 repetition reduces the probability of a false positive by
                 a factor at least 4. The default for repetitions is 4.

          Unknown options are silently ignored.

BUGS, IDEAS, FEEDBACK

   This document, and the package it describes, will  undoubtedly  contain
   bugs  and  other  problems.  Please report such in the category math ::
   numtheory          of           the           Tcllib           Trackers
   [http://core.tcl.tk/tcllib/reportlist].   Please  also report any ideas
   for enhancements you may have for either package and/or documentation.

KEYWORDS

   number theory, prime

CATEGORY

   Mathematics

COPYRIGHT

   Copyright (c) 2010 Lars Hellstrm <Lars dot Hellstrom at residenset dot net>





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.