%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%  nmbrthry_functions.tex       LiDIA documentation
%%
%%  This file contains the documentation of the elementary
%%  number-theoretical functions.
%%
%%  Copyright   (c)   1996   by  LiDIA-Group
%%      
%%  Authors: Markus Maurer, Volker Mueller
%%

\begin{lidia_man}

\markright{\BF{number-theoretic functions}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NAME
\BF{number-theoretic functions} \DOTFILL         a collection of basic
number-theoretic functions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ABSTRACT 
Including \BF{nmbrthry\_functions.h} allows the use of some
basic number-theoretic functions, e.g., computing 
all divisors of an integer number. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\DESCRIPTION 

\fcode{sort\_vector < bigint >}{divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}

\fcode{sort\_vector < bigint >}{divisors}{const bigint \& N} { returns
  a sorted vector of all positive divisors of
  \MATH{N} (in ascending order).}


\fcode{sort\_vector < bigint >}{all\_divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive and negative divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}

\fcode{sort\_vector < bigint >}{all\_divisors}{const bigint \& N} { returns
  a sorted vector of all positive and negative divisors of
  \MATH{N} (in ascending order).}




\fcode{sort\_vector < bigint >}{square\_free\_divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive square-free divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}

\fcode{sort\_vector < bigint >}{square\_free\_divisors}{const bigint \& N} { returns
  a sorted vector of all positive square-free divisors of
  \MATH{N} (in ascending order).}


\fcode{sort\_vector < bigint >}{all\_square\_free\_divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive and negative square-free divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}
\fcode{sort\_vector < bigint >}{all\_square\_free\_divisors}{const bigint \& N} { returns
  a sorted vector of all positive and negative square-free divisors of
  \MATH{N} (in ascending order).}



\fcode{sort\_vector < bigint >}{square\_divides\_n\_divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive square-free divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}

\fcode{sort\_vector < bigint >}{square\_divides\_n\_divisors}{const bigint \& N} { returns
  a sorted vector of all positive square-free divisors of
  \MATH{N} (in ascending order).}


\fcode{sort\_vector < bigint >}{all\_square\_divides\_n\_divisors}{rational\_factorization \& f}
{ returns a sorted vector of all positive and negative square-free divisors of the number
  represented by \MATH{f} (in ascending order). If \MATH{f} is no prime
  factorization, the function tries to refine \MATH{f} to a
  prime factorization. In this case, the computed prime factorization
  is assigned to \MATH{f}.}

\fcode{sort\_vector < bigint >}{all\_square\_divides\_n\_divisors}{const bigint \& N} { returns
  a sorted vector of all positive and negative square-free divisors of
  \MATH{N} (in ascending order).}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\SEEALSO
\BF{bigint}, \BF{rational\_factorization}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\EXAMPLES
\begin{verbatim}
#include <LiDIA/nmbrthry_functions.h>

void main()
{
  bigint n;

  cout << "Please enter a bigint n = ";
  cin  >> n;

  cout << "all divisors of " << n << ": " << divisors(n);
  cout << "\n";
}
\end{verbatim}



\AUTHOR
Markus Maurer, Volker M\"uller

\end{lidia_man}
