| Home | Trees | Indices | Help |
|---|
|
|
Functions that compute some of the sequences in Sloane's tables
EXAMPLES:
Type sloane.[tab] to see a list of the sequences that are defined.
sage: a = sloane.A000005; a
The integer sequence tau(n), which is the number of divisors of n.
sage: a(1)
1
sage: a(6)
4
sage: a(100)
9
Type \code{d._eval??} to see how the function that computes an individual
term of the sequence is implemented.
The input must be a positive integer:
sage: a(0)
Traceback (most recent call last):
...
ValueError: input n (=0) must be a positive integer
sage: a(1/3)
Traceback (most recent call last):
...
TypeError: input must be an int, long, or Integer
You can also change how a sequence prints:
sage: a = sloane.A000005; a
The integer sequence tau(n), which is the number of divisors of n.
sage: a.rename('(..., tau(n), ...)')
sage: a
(..., tau(n), ...)
sage: a.reset_name()
sage: a
The integer sequence tau(n), which is the number of divisors of n.
TESTS:
sage: a = sloane.A000001;
sage: a == loads(dumps(a))
True
AUTHORS:
-- William Stein: framework
-- Jaap Spies: most sequences
-- Nick Alexander: updated framework
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Integer =
|
|||
sloane = <class 'sage.combinat.sloane_functions.Sloane'>
|
|||
|
|||
inhomogenous second-order linear recurrence generator with fixed coefficients
and $b = f(n)$
$a(0) = a0$, $a(1) = a1$, $a(n) = a2*a(n-1) + a3*a(n-2) +f(n)$.
EXAMPLES:
sage: from sage.combinat.sloane_functions import recur_gen2b
sage: it = recur_gen2b(1,1,1,1, lambda n: 0)
sage: [it.next() for i in range(10)]
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
|
homogenous general second-order linear recurrence generator with fixed coefficients
a(0) = a0, a(1) = a1, a(n) = a2*a(n-1) + a3*a(n-2)
EXAMPLES:
sage: from sage.combinat.sloane_functions import recur_gen2
sage: it = recur_gen2(1,1,1,1)
sage: [it.next() for i in range(10)]
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
|
homogenous general third-order linear recurrence generator with fixed coefficients
a(0) = a0, a(1) = a1, a(2) = a2, a(n) = a3*a(n-1) + a4*a(n-2) + a5*a(n-3)
EXAMPLES:
sage: from sage.combinat.sloane_functions import recur_gen3
sage: it = recur_gen3(1,1,1,1,1,1)
sage: [it.next() for i in range(10)]
[1, 1, 1, 3, 5, 9, 17, 31, 57, 105]
|
This functions calculates $f(g,h)$ from Sloane's sequences A079908-A079928
INPUT:
m -- positive integer
h -- non negative integer
OUTPUT:
permanent of the m x (m+h) matrix, etc.
EXAMPLES:
sage: from sage.combinat.sloane_functions import perm_mh
sage: perm_mh(3,3)
36
sage: perm_mh(3,4)
76
AUTHOR: Jaap Spies (2006)
|
|
|||
Integer
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:25 2008 | http://epydoc.sourceforge.net |