  
  [1X3 [33X[0;0YNumber-theoretic functions[133X[101X
  
  
  [1X3.1 [33X[0;0YFunctions for integers[133X[101X
  
  [1X3.1-1 AllSmoothIntegers[101X
  
  [29X[2XAllSmoothIntegers[102X( [3Xmaxp[103X, [3Xmaxn[103X ) [32X function
  
  [33X[0;0YThis  function is in the process of being transferred from package [5XRCWA[105X: for
  now you should [10XLoadPackage("rcwa")[110X in order to use it.[133X
  
  [33X[0;0YThe  function  [10XAllSmoothIntegers([3Xmaxp[103X[10X,[3Xmaxn[103X[10X)[110X  returns  a list of all integers
  less than or equal to [3Xmaxn[103X which do not have prime divisors exceeding [3Xmaxp[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XAllSmoothIntegers( 7, 100 );[127X[104X
    [4X[28X[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28, [128X[104X
    [4X[28X  30, 32, 35, 36, 40, 42, 45, 48, 49, 50, 54, 56, 60, 63, 64, 70, 72, 75, 80, [128X[104X
    [4X[28X  81, 84, 90, 96, 98, 100 ][128X[104X
    [4X[25Xgap>[125X [27XLength(last);[127X[104X
    [4X[28X46[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.1-2 AllProducts[101X
  
  [29X[2XAllProducts[102X( [3XL[103X, [3Xk[103X ) [32X function
  
  [33X[0;0YThis function has been transferred from package [5XRCWA[105X.[133X
  
  [33X[0;0YThe  command  [10XAllProducts([3XL[103X[10X,[3Xk[103X[10X)[110X returns the list of all products of [3Xk[103X entries
  of  the  list [3XL[103X. Note that every ordering of the entries is used so that, in
  the commuting case, there are bound to be repetitions.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XAllProducts([1..4],3); [127X[104X
    [4X[28X[ 1, 2, 3, 4, 2, 4, 6, 8, 3, 6, 9, 12, 4, 8, 12, 16, 2, 4, 6, 8, 4, 8, 12, [128X[104X
    [4X[28X  16, 6, 12, 18, 24, 8, 16, 24, 32, 3, 6, 9, 12, 6, 12, 18, 24, 9, 18, 27, [128X[104X
    [4X[28X  36, 12, 24, 36, 48, 4, 8, 12, 16, 8, 16, 24, 32, 12, 24, 36, 48, 16, 32, [128X[104X
    [4X[28X  48, 64 ][128X[104X
    [4X[25Xgap>[125X [27XSet(last);            [127X[104X
    [4X[28X[ 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 64 ][128X[104X
    [4X[25Xgap>[125X [27XAllProducts( [(1,2,3),(2,3,4)], 2 );[127X[104X
    [4X[28X[ (2,4,3), (1,2)(3,4), (1,3)(2,4), (1,3,2) ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.1-3 RestrictedPartitionsWithoutRepetitions[101X
  
  [29X[2XRestrictedPartitionsWithoutRepetitions[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0YThis  function is in the process of being transferred from package [5XRCWA[105X: for
  now you should [10XLoadPackage("rcwa")[110X in order to use it.[133X
  
  [33X[0;0YGiven  a  positive integer [3Xn[103X and a set of positive integers [3XS[103X, this function
  returns  a list of all partitions of [3Xn[103X into distinct elements of [3XS[103X. The only
  difference to [10XRestrictedPartitions[110X is that no repetitions are allowed.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XRestrictedPartitions( 20, [4..10] );[127X[104X
    [4X[28X[ [ 4, 4, 4, 4, 4 ], [ 5, 5, 5, 5 ], [ 6, 5, 5, 4 ], [ 6, 6, 4, 4 ], [128X[104X
    [4X[28X  [ 7, 5, 4, 4 ], [ 7, 7, 6 ], [ 8, 4, 4, 4 ], [ 8, 6, 6 ], [ 8, 7, 5 ], [128X[104X
    [4X[28X  [ 8, 8, 4 ], [ 9, 6, 5 ], [ 9, 7, 4 ], [ 10, 5, 5 ], [ 10, 6, 4 ], [128X[104X
    [4X[28X  [ 10, 10 ] ][128X[104X
    [4X[25Xgap>[125X [27XRestrictedPartitionsWithoutRepetitions( 20, [4..10] );[127X[104X
    [4X[28X[ [ 10, 6, 4 ], [ 9, 7, 4 ], [ 9, 6, 5 ], [ 8, 7, 5 ] ][128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.1-4 ExponentOfPrime[101X
  
  [29X[2XExponentOfPrime[102X( [3Xn[103X, [3Xp[103X ) [32X function
  
  [33X[0;0YThis  function is in the process of being transferred from package [5XRCWA[105X: for
  now you should [10XLoadPackage("rcwa")[110X in order to use it.[133X
  
  [33X[0;0YThe function [10XExponentOfPrime([3Xn[103X[10X,[3Xp[103X[10X)[110X returns the exponent of the prime [3Xp[103X in the
  prime factorization of [3Xn[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27XExponentOfPrime( 13577531, 11 ); [127X[104X
    [4X[28X3[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.1-5 NextProbablyPrimeInt[101X
  
  [29X[2XNextProbablyPrimeInt[102X( [3Xn[103X ) [32X function
  
  [33X[0;0YThis  function is in the process of being transferred from package [5XRCWA[105X: for
  now you should [10XLoadPackage("rcwa")[110X in order to use it.[133X
  
  [33X[0;0YThe function [10XNextProbablyPrimeInt([3Xn[103X[10X)[110X does the same as [10XNextPrimeInt([3Xn[103X[10X)[110X except
  that    for   reasons   of   performance   it   tests   numbers   only   for
  [10XIsProbablyPrimeInt([3Xn[103X[10X)[110X  instead  of [10XIsPrimeInt([3Xn[103X[10X)[110X. For large [3Xn[103X, this function
  is much faster than [10XNextPrimeInt([3Xn[103X[10X)[110X[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xn := 2^251;[127X[104X
    [4X[28X3618502788666131106986593281521497120414687020801267626233049500247285301248[128X[104X
    [4X[25Xgap>[125X [27Xtime;      [127X[104X
    [4X[28X0[128X[104X
    [4X[25Xgap>[125X [27XNextProbablyPrimeInt( n );[127X[104X
    [4X[28X3618502788666131106986593281521497120414687020801267626233049500247285301313[128X[104X
    [4X[25Xgap>[125X [27Xtime;                     [127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27XNextPrimeInt( n );        [127X[104X
    [4X[28X3618502788666131106986593281521497120414687020801267626233049500247285301313[128X[104X
    [4X[25Xgap>[125X [27Xtime;             [127X[104X
    [4X[28X12346[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
  [1X3.1-6 PrimeNumbersIterator[101X
  
  [29X[2XPrimeNumbersIterator[102X( [[3Xchunksize[103X] ) [32X function
  
  [33X[0;0YThis  function is in the process of being transferred from package [5XRCWA[105X: for
  now you should [10XLoadPackage("rcwa")[110X in order to use it.[133X
  
  [33X[0;0YThis  function  returns  an  iterator  which  runs  over the prime numbers n
  ascending order; it takes an optional argument [10Xchunksize[110X which specifies the
  length  of the interval which is sieved in one go (the default is [22X10^7[122X), and
  which  can  be used to balance runtime vs. memory consumption. It is assumed
  that  [10Xchunksize[110X is larger than any gap between two consecutive primes within
  the range one intends to run the iterator over.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X[128X[104X
    [4X[25Xgap>[125X [27Xiter := PrimeNumbersIterator();[127X[104X
    [4X[28X<iterator>[128X[104X
    [4X[25Xgap>[125X [27XNextIterator( iter ); [127X[104X
    [4X[28X2[128X[104X
    [4X[28X[128X[104X
  [4X[32X[104X
  
