Package sage :: Package combinat :: Module expnums
[hide private]
[frames] | no frames]

Module expnums



File: sage/combinat/expnums.pyx (starting at line 1)

Compute Bell and Uppuluri-Carpenter numbers.

AUTHOR:
    -- Nick Alexander



Functions [hide private]
 
clear_mpz_globals(...)
File: sage/combinat/../ext/gmp.pxi (starting at line 32)
 
expnums(...)
File: sage/combinat/expnums.pyx (starting at line 17) Compute the first $n$ exponential numbers around $aa$, starting with the zero-th.
 
expnums2(...)
File: sage/combinat/expnums.pyx (starting at line 113) A vanilla python (but compiled via pyrex) implementation of expnums.
 
gmp_randrange(...)
File: sage/combinat/../ext/gmp.pxi (starting at line 232)
 
init_mpz_globals(...)
File: sage/combinat/../ext/gmp.pxi (starting at line 29)
Variables [hide private]
  ZZ = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1...
Function Details [hide private]

expnums(...)

 
File: sage/combinat/expnums.pyx (starting at line 17)

Compute the first $n$ exponential numbers around $aa$, starting
with the zero-th.

INPUT:
     n -- C machine int
     aa -- C machine int

OUTPUT:
     A list of length $n$.

ALGORITHM: We use the same integer addition algorithm as GAP.
This is an extension of Bell's triangle to the general case of
exponential numbers.  The recursion performs $O(n^2)$ additions,
but the running time is dominated by the cost of the last integer
addition, because the growth of the integer results of partial
computations is exponential in $n$.  The algorithm stores $O(n)$
integers, but each is exponential in $n$.

EXAMPLES:
    sage: expnums(10, 1)
    [1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147]

    sage: expnums(10, -1)
    [1, -1, 0, 1, 1, -2, -9, -9, 50, 267]

    sage: expnums(1, 1)
    [1]
    sage: expnums(0, 1)
    []
    sage: expnums(-1, 0)
    []

AUTHOR:
    -- Nick Alexander

expnums2(...)

 
File: sage/combinat/expnums.pyx (starting at line 113)

A vanilla python (but compiled via pyrex) implementation of expnums.

We Compute the first $n$ exponential numbers around $aa$, starting
with the zero-th.

EXAMPLES:
    sage: from sage.combinat.expnums import expnums2
    sage: expnums2(10, 1)
    [1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147]


Variables Details [hide private]

ZZ

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...