code stringlengths 17 6.64M |
|---|
class ShuffleProduct_overlapping(ShuffleProduct_abstract):
"\n The overlapping shuffle product of the two words ``w1`` and\n ``w2``.\n\n If `u` and `v` are two words whose letters belong to an\n additive monoid or to another kind of alphabet on which addition\n is well-defined, then the *overlappin... |
def sidon_sets(N, g=1):
"\n Return the set of all Sidon-`g` sets that have elements less than or equal\n to `N`.\n\n A Sidon-`g` set is a set of positive integers `A \\subset [1, N]` such\n that any integer `M` can be obtain at most `g` times as sums of unordered pairs of\n elements of `A` (the two... |
@cached_function
def sidon_sets_rec(N, g=1):
'\n Return the set of all Sidon-`g` sets that have elements less than or equal\n to `N` without checking the arguments. This internal function should not\n be call directly by user.\n\n TESTS::\n\n sage: from sage.combinat.sidon_sets import sidon_set... |
@cached_function
def fq(n, q=None):
'\n Return `(1-q^{-1}) (1-q^{-2}) \\cdots (1-q^{-n})`.\n\n INPUT:\n\n - ``n`` -- a non-negative integer\n\n - ``q`` -- an integer or an indeterminate\n\n OUTPUT:\n\n A rational function in ``q``.\n\n EXAMPLES::\n\n sage: from sage.combinat.similarity... |
@cached_function
def primitives(n, invertible=False, q=None):
'\n Return the number of similarity classes of simple matrices\n of order ``n`` with entries in a finite field of order ``q``.\n This is the same as the number of irreducible polynomials\n of degree `d`.\n\n If ``invertible`` is ``True``... |
@cached_function
def order_of_general_linear_group(n, q=None):
'\n Return the cardinality of the group of `n \\times n` invertible matrices\n with entries in a field of order ``q``.\n\n INPUT:\n\n - ``n`` -- a non-negative integer\n\n - ``q`` -- an integer or an indeterminate\n\n EXAMPLES::\n\n ... |
@cached_function
def centralizer_algebra_dim(la):
'\n Return the dimension of the centralizer algebra in `M_n(\\GF{q})`\n of a nilpotent matrix whose Jordan blocks are given by ``la``.\n\n EXAMPLES::\n\n sage: from sage.combinat.similarity_class_type import centralizer_algebra_dim\n sage: c... |
@cached_function
def centralizer_group_cardinality(la, q=None):
"\n Return the cardinality of the centralizer group in `GL_n(\\GF{q})`\n of a nilpotent matrix whose Jordan blocks are given by ``la``.\n\n INPUT:\n\n - ``lambda`` -- a partition\n\n - ``q`` -- an integer or an indeterminate\n\n OUT... |
def invariant_subspace_generating_function(la, q=None, t=None):
'\n Return the invariant subspace generating function of a nilpotent matrix with\n Jordan block sizes given by ``la``.\n\n INPUT:\n\n - ``la`` -- a partition\n - ``q`` -- (optional) an integer or an inderminate\n - ``t`` -- (optiona... |
class PrimarySimilarityClassType(Element, metaclass=InheritComparisonClasscallMetaclass):
'\n A primary similarity class type is a pair consisting of a partition and a positive\n integer.\n\n For a partition `\\lambda` and a positive integer `d`, the primary similarity\n class type `(d, \\lambda)` rep... |
class PrimarySimilarityClassTypes(UniqueRepresentation, Parent):
'\n All primary similarity class types of size ``n`` whose degree is greater\n than that of ``min`` or whose degree is that of ``min`` and whose partition\n is less than of ``min`` in lexicographic order.\n\n A primary similarity class ... |
class SimilarityClassType(CombinatorialElement):
'\n A similarity class type.\n\n A matrix type is a multiset of primary similarity class types.\n\n INPUT:\n\n - ``tau`` -- a list of primary similarity class types or a square matrix\n over a finite field\n\n EXAMPLES::\n\n sage: tau1 = ... |
class SimilarityClassTypes(UniqueRepresentation, Parent):
'\n Class of all similarity class types of size ``n`` with all primary matrix\n types greater than or equal to the primary matrix type ``min``.\n\n A similarity class type is a multiset of primary matrix types.\n\n INPUT:\n\n - ``n`` -- a no... |
def dictionary_from_generator(gen):
"\n Given a generator for a list of pairs `(c,f)`, construct a dictionary whose\n keys are the distinct values for `c` and whose value at `c` is the sum of\n `f` over all pairs of the form `(c',f)` such that `c=c'`.\n\n EXAMPLES::\n\n sage: from sage.combinat... |
def matrix_similarity_classes(n, q=None, invertible=False):
'\n Return the number of matrix similarity classes over a finite field of order\n ``q``.\n\n TESTS::\n\n sage: from sage.combinat.similarity_class_type import matrix_similarity_classes\n sage: matrix_similarity_classes(2)\n ... |
def matrix_centralizer_cardinalities(n, q=None, invertible=False):
'\n Generate pairs consisting of centralizer cardinalities of matrices over a\n finite field and their frequencies.\n\n TESTS::\n\n sage: from sage.combinat.similarity_class_type import matrix_centralizer_cardinalities\n sag... |
def input_parsing(data):
"\n Recognize and return the intended type of ``input``.\n\n TESTS::\n\n sage: from sage.combinat.similarity_class_type import input_parsing\n sage: input_parsing(Partition([2, 1]))\n ('par', [2, 1])\n sage: input_parsing(PrimarySimilarityClassType(2, [2,... |
def ext_orbits(input_data, q=None, selftranspose=False):
'\n Return the number of orbits in `\\mathrm{Ext}^1(M, M)` for the action of\n `\\mathrm{Aut}(M, M)`, where `M` is the `\\GF{q[t]}`-module constructed\n from ``input_data``.\n\n INPUT:\n\n - ``input_data`` -- input for :func:`input_parsing()`... |
def matrix_similarity_classes_length_two(n, q=None, selftranspose=False, invertible=False):
'\n Return the number of similarity classes of matrices of order ``n`` with\n entries in a principal ideal local ring of length two.\n\n INPUT:\n\n - ``n`` -- the order\n - ``q`` -- (default: `q`) an integer... |
def ext_orbit_centralizers(input_data, q=None, selftranspose=False):
'\n Generate pairs consisting of centralizer cardinalities of orbits in\n `\\mathrm{Ext}^1(M, M)` for the action of `\\mathrm{Aut}(M, M)`, where `M` is\n the `\\GF{q[t]}`-module constructed from ``input`` and their frequencies.\n\n I... |
def matrix_centralizer_cardinalities_length_two(n, q=None, selftranspose=False, invertible=False):
'\n Generate pairs consisting of centralizer cardinalities of matrices over a\n principal ideal local ring of length two with residue field of order ``q``\n and their frequencies.\n\n INPUT:\n\n - ``n... |
class SineGordonYsystem(SageObject):
"\n A class to model a (reduced) sine-Gordon Y-system\n\n Note that the generations, together with all integer tuples, in this\n implementation are numbered from 0 while in [NS]_ they are numbered from 1\n\n INPUT:\n\n - ``X`` -- the type of the Y-system to cons... |
class SixVertexConfiguration(ClonableArray):
'\n A configuration in the six vertex model.\n '
def check(self):
"\n Check if ``self`` is a valid 6 vertex configuration.\n\n EXAMPLES::\n\n sage: M = SixVertexModel(3, boundary_conditions='ice')\n sage: M[0].chec... |
class SixVertexModel(UniqueRepresentation, Parent):
"\n The six vertex model.\n\n We model a configuration by indicating which configuration by the\n following six configurations which are determined by the two outgoing\n arrows in the Up, Right, Down, Left directions:\n\n 1. LR::\n\n |\... |
class SquareIceModel(SixVertexModel):
'\n The square ice model.\n\n The square ice model is a 6 vertex model on an `n \\times n` grid with\n the boundary conditions that the top and bottom boundaries are pointing\n outward and the left and right boundaries are pointing inward. These\n boundary cond... |
class SkewPartition(CombinatorialElement):
'\n A skew partition.\n\n A skew partition of shape `\\lambda / \\mu` is the Young diagram from the\n partition `\\lambda` and removing the partition `\\mu` from the upper-left\n corner in English convention.\n '
@staticmethod
def __classcall_priv... |
def row_lengths_aux(skp):
'\n EXAMPLES::\n\n sage: from sage.combinat.skew_partition import row_lengths_aux\n sage: row_lengths_aux([[5,4,3,1],[3,3,1]])\n [2, 1, 2]\n sage: row_lengths_aux([[5,4,3,1],[3,1]])\n [2, 3]\n '
if (skp[0] == []):
return []
else:
... |
class SkewPartitions(UniqueRepresentation, Parent):
'\n Skew partitions.\n\n .. WARNING::\n\n The iterator of this class only yields skew partitions which\n are reduced, in the sense that there are no empty rows\n before the last nonempty row, and there are no empty columns\n bef... |
class SkewPartitions_all(SkewPartitions):
'\n Class of all skew partitions.\n '
def __init__(self):
'\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = SkewPartitions()\n sage: TestSuite(S).run()\n '
SkewPartitions.__init__(self, True)
d... |
class SkewPartitions_n(SkewPartitions):
'\n The set of skew partitions of ``n`` with overlap at least\n ``overlap`` and no empty row.\n\n INPUT:\n\n - ``n`` -- a non-negative integer\n\n - ``overlap`` -- an integer (default: `0`)\n\n Caveat: this set is stable under conjugation only for ``overla... |
class SkewPartitions_rowlengths(SkewPartitions):
'\n All skew partitions with given row lengths.\n '
@staticmethod
def __classcall_private__(cls, co, overlap=0):
"\n Normalize input to ensure a unique representation.\n\n EXAMPLES::\n\n sage: S = SkewPartitions(row_l... |
class SkewTableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass):
'\n A skew tableau.\n\n Note that Sage by default uses the English convention for partitions and\n tableaux. To change this, see :meth:`Tableaux.options`.\n\n EXAMPLES::\n\n sage: st = SkewTableau([[None, 1],[2,3]]... |
def _label_skew(list_of_cells, sk):
'\n Return a filled-in standard skew tableau given an\n ordered list ``list_of_cells`` of the coordinates to fill in\n (as pairs) and an empty shape ``sk``.\n\n EXAMPLES::\n\n sage: import sage.combinat.skew_tableau as skew_tableau\n sage: l = [(0, 0),... |
class SkewTableaux(UniqueRepresentation, Parent):
'\n Class of all skew tableaux.\n '
def __init__(self, category=None):
'\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = SkewTableaux()\n sage: TestSuite(S).run()\n '
if (category is None):
... |
class StandardSkewTableaux(SkewTableaux):
'\n Standard skew tableaux.\n\n EXAMPLES::\n\n sage: S = StandardSkewTableaux(); S\n Standard skew tableaux\n sage: S.cardinality()\n +Infinity\n\n ::\n\n sage: S = StandardSkewTableaux(2); S\n Standard skew tableaux of s... |
class StandardSkewTableaux_all(StandardSkewTableaux):
'\n Class of all standard skew tableaux.\n '
def __init__(self):
'\n EXAMPLES::\n\n sage: s = StandardSkewTableaux()\n sage: TestSuite(s).run() # needs sage.grap... |
class StandardSkewTableaux_size(StandardSkewTableaux):
'\n Standard skew tableaux of a fixed size `n`.\n '
def __init__(self, n):
'\n EXAMPLES::\n\n sage: # needs sage.graphs sage.modules\n sage: S = StandardSkewTableaux(3)\n sage: TestSuite(S).run()\n ... |
class StandardSkewTableaux_shape(StandardSkewTableaux):
'\n Standard skew tableaux of a fixed skew shape `\\lambda / \\mu`.\n '
@staticmethod
def __classcall_private__(cls, skp):
'\n Normalize input to ensure a unique representation.\n\n EXAMPLES::\n\n sage: S = Sta... |
class SemistandardSkewTableaux(SkewTableaux):
'\n Semistandard skew tableaux.\n\n This class can be initialized with several optional variables:\n the size of the skew tableaux (as a nameless integer variable),\n their shape (as a nameless skew partition variable), their\n weight (:meth:`~sage.comb... |
class SemistandardSkewTableaux_all(SemistandardSkewTableaux):
'\n Class of all semistandard skew tableaux, possibly with a given\n maximum entry.\n '
def __init__(self, max_entry):
'\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = SemistandardSkewTableaux()\n ... |
class SemistandardSkewTableaux_size(SemistandardSkewTableaux):
'\n Class of all semistandard skew tableaux of a fixed size `n`,\n possibly with a given maximum entry.\n '
def __init__(self, n, max_entry):
'\n EXAMPLES::\n\n sage: S = SemistandardSkewTableaux(3)\n ... |
class SemistandardSkewTableaux_size_weight(SemistandardSkewTableaux):
'\n Class of semistandard tableaux of a fixed size `n` and weight `\\mu`.\n '
@staticmethod
def __classcall_private__(cls, n, mu):
'\n Normalize our input to ensure we have a unique representation.\n\n EXAMP... |
class SemistandardSkewTableaux_shape(SemistandardSkewTableaux):
'\n Class of semistandard skew tableaux of a fixed skew shape\n `\\lambda / \\mu` with a given max entry.\n\n A semistandard skew tableau with max entry `i` is required to have all\n its entries less or equal to `i`. It is not required to... |
class SemistandardSkewTableaux_shape_weight(SemistandardSkewTableaux):
'\n Class of semistandard skew tableaux of a fixed skew shape `\\lambda / \\nu`\n and weight `\\mu`.\n '
@staticmethod
def __classcall_private__(cls, p, mu):
'\n Normalize our input to ensure we have a unique r... |
class SkewTableau_class(SkewTableau):
'\n This exists solely for unpickling ``SkewTableau_class`` objects.\n '
def __setstate__(self, state):
"\n Unpickle old ``SkewTableau_class`` objects.\n\n TESTS::\n\n sage: loads(b'x\\x9ck`J.NLO\\xd5K\\xce\\xcfM\\xca\\xccK,\\xd1+H,... |
class SloaneSequence(SageObject):
'\n Base class for a Sloane integer sequence.\n '
def __init__(self, offset=1):
'\n A sequence starting at offset (=1 by default).\n\n EXAMPLES::\n\n sage: from sage.combinat.sloane_functions import SloaneSequence\n sage: Slo... |
class A000001(SloaneSequence):
def __init__(self):
'\n Number of groups of order `n`.\n\n INPUT:\n\n - ``n`` -- positive integer\n\n OUTPUT: integer\n\n EXAMPLES::\n\n sage: a = sloane.A000001;a\n Number of groups of order n.\n sage: a(0... |
class A000027(SloaneSequence):
def __init__(self):
'\n The natural numbers. Also called the whole numbers, the counting\n numbers or the positive integers.\n\n The following examples are tests of SloaneSequence more than\n A000027.\n\n EXAMPLES::\n\n sage: s ... |
class A000004(SloaneSequence):
def __init__(self):
'\n The zero sequence.\n\n INPUT:\n\n - ``n`` - non negative integer\n\n EXAMPLES::\n\n sage: a = sloane.A000004; a\n The zero sequence.\n sage: a(1)\n 0\n sage: a(2007)\n... |
class A000005(SloaneSequence):
def __init__(self):
'\n The sequence `tau(n)`, which is the number of divisors of `n`.\n\n This sequence is also denoted `d(n)` (also called\n `\\tau(n)` or `\\sigma_0(n)`), the number of\n divisors of `n`.\n\n INPUT:\n\n - ``n`` - ... |
class A000008(SloaneSequence):
def __init__(self):
'\n Number of ways of making change for n cents using coins\n of 1, 2, 5, 10 cents.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A000009(SloaneSequence):
def __init__(self):
'\n Number of partitions of `n` into odd parts.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000009;a\n ... |
class A000796(SloaneSequence):
def __init__(self):
'\n Decimal expansion of `\\pi`.\n\n INPUT:\n\n - ``n`` -- positive integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000796;a\n Decimal expansion ... |
class A003418(SloaneSequence):
def __init__(self):
'\n Least common multiple (or lcm) of `\\{1, 2, \\ldots, n\\}`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A00341... |
class A007318(SloaneSequence):
def __init__(self):
"\n Pascal's triangle read by rows:\n `C(n,k) = \\binom{n}{k} = \\frac {n!} {(k!(n-k)!)}`,\n `0 \\le k \\le n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function valu... |
class A008275(SloaneSequence):
def __init__(self):
'\n Triangle of Stirling numbers of first kind, `s(n,k)`,\n `n \\ge 1`, `1 \\le k \\le n`.\n\n The unsigned numbers are also called Stirling cycle numbers:\n\n `|s(n,k)|` = number of permutations of `n` objects\n with e... |
class A008277(SloaneSequence):
def __init__(self):
'\n Triangle of Stirling numbers of 2nd kind, `S2(n,k)`,\n `n \\ge 1`, `1 \\le k \\le n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A049310(SloaneSequence):
def __init__(self):
"\n Triangle of coefficients of Chebyshev's `S(n,x)`:\n `U(n, \\frac x 2)` polynomials (exponents in increasing\n order).\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- fun... |
class A000010(SloaneSequence):
def __init__(self):
"\n The integer sequence A000010 is Euler's totient function.\n\n Number of positive integers `i < n` that are relative prime\n to `n`. Number of totatives of `n`.\n\n Euler totient function `\\phi(n)`: count numbers `n`\n ... |
class A000007(SloaneSequence):
def __init__(self):
'\n The characteristic function of 0: `a(n) = 0^n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000007;a\n ... |
class A005843(SloaneSequence):
def __init__(self):
'\n The even numbers: `a(n) = 2n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A005843;a\n The even num... |
class A000035(SloaneSequence):
def __init__(self):
'\n A simple periodic sequence.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000035;a\n A simple period... |
class A000169(SloaneSequence):
def __init__(self):
'\n Number of labeled rooted trees with `n` nodes:\n `n^{(n-1)}`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloa... |
class A000272(SloaneSequence):
def __init__(self):
'\n Number of labeled rooted trees on `n` nodes: `n^{(n-2)}`.\n\n INPUT:\n\n - ``n`` -- integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000272;a\n ... |
class A000312(SloaneSequence):
def __init__(self):
'\n Number of labeled mappings from `n` points to themselves\n (endofunctions): `n^n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A001477(SloaneSequence):
def __init__(self):
'\n The nonnegative integers.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A001477;a\n The nonnegative i... |
class A004526(SloaneSequence):
def __init__(self):
'\n The nonnegative integers repeated.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A004526;a\n The nonn... |
class A000326(SloaneSequence):
def __init__(self):
'\n Pentagonal numbers: `n(3n-1)/2`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000326;a\n Pentagonal... |
class A002378(SloaneSequence):
def __init__(self):
'\n Oblong (or pronic, or heteromecic) numbers: `n(n+1)`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A002378;a\n ... |
class A002620(SloaneSequence):
def __init__(self):
'\n Quarter-squares: floor(n/2)\\*ceiling(n/2). Equivalently,\n `\\lfloor n^2/4 \\rfloor`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A005408(SloaneSequence):
def __init__(self):
'\n The odd numbers a(n) = 2n + 1.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A005408;a\n The odd numb... |
class A000012(SloaneSequence):
def __init__(self):
"\n The all 1's sequence.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000012; a\n The all 1's sequence... |
class A000120(SloaneSequence):
def __init__(self):
"\n 1's-counting sequence: number of 1's in binary expansion of `n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A... |
class A010060(SloaneSequence):
def __init__(self):
"\n Thue-Morse sequence.\n\n Let `A_k` denote the first `2^k` terms; then\n `A_0 = 0`, and for `k \\ge 0`,\n `A_{k+1} = A_k B_k`, where `B_k` is obtained\n from `A_k` by interchanging 0's and 1's.\n\n INPUT:\n\n ... |
class A000069(SloaneSequence):
def __init__(self):
"\n Odious numbers: odd number of 1's in binary expansion.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000069; a\... |
class A001969(SloaneSequence):
def __init__(self):
"\n Evil numbers: even number of 1's in binary expansion.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A001969;a\n ... |
class A000290(SloaneSequence):
def __init__(self):
'\n The squares: `a(n) = n^2`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000290;a\n The squares: a(n... |
class A000225(SloaneSequence):
def __init__(self):
'\n `2^n - 1`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000225;a\n 2^n - 1.\n sage: a(0)... |
class A000015(SloaneSequence):
def __init__(self):
'\n Smallest prime power `\\geq n` (where `1` is considered a prime\n power).\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sa... |
class A000016(SloaneSequence):
def __init__(self):
"\n Sloane's A000016\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000016; a\n Sloane's A000016.\n ... |
class A000032(SloaneSequence):
def __init__(self):
'\n Lucas numbers (beginning at 2): `L(n) = L(n-1) + L(n-2)`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000032;... |
class A004086(SloaneSequence):
def __init__(self):
'\n Read n backwards (referred to as `R(n)` in many\n sequences).\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloa... |
class A002113(SloaneSequence):
def __init__(self):
'\n Palindromes in base 10.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A002113;a\n Palindromes in base... |
class A000030(SloaneSequence):
def __init__(self):
'\n Initial digit of `n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000030; a\n Initial digit of n\n... |
class A000040(SloaneSequence):
def __init__(self):
'\n The prime numbers.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000040; a\n The prime numbers.\n ... |
class A002808(SloaneSequence):
def __init__(self):
'\n The composite numbers: numbers `n` of the form `xy`\n for `x > 1` and `y > 1`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A018252(SloaneSequence):
def __init__(self):
'\n The nonprime numbers, starting with 1.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A018252;a\n The ... |
class A000043(SloaneSequence):
def __init__(self):
'\n Primes `p` such that `2^p - 1` is prime.\n `2^p - 1` is then called a Mersenne prime.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n ... |
class A000668(SloaneSequence):
def __init__(self):
'\n Mersenne primes (of form `2^p - 1` where `p` is a\n prime).\n\n (See A000043 for the values of `p`.)\n\n Warning: a(39) has 4,053,946 digits!\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\... |
class A000396(SloaneSequence):
def __init__(self):
'\n Perfect numbers: equal to sum of proper divisors.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000396;a\n ... |
class A005100(SloaneSequence):
def __init__(self):
'\n Deficient numbers: `\\sigma(n) < 2n`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A005100;a\n Defic... |
class A005101(SloaneSequence):
def __init__(self):
'\n Abundant numbers (sum of divisors of `n` exceeds\n `2n`).\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A... |
class A002110(SloaneSequence):
def __init__(self):
'\n Primorial numbers (first definition): product of first `n`\n primes. Sometimes written `p\\#`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLE... |
class A000720(SloaneSequence):
def __init__(self):
'\n `pi(n)`, the number of primes `\\le n`. Sometimes\n called `PrimePi(n)`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sag... |
class A064553(SloaneSequence):
def __init__(self):
'\n `a(1) = 1`, `a(prime(i)) = i + 1` for\n `i > 0` and `a(u \\cdot v) = a(u) \\cdot a(v)` for\n `u, v > 0`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n... |
class A001055(SloaneSequence):
def __init__(self):
'\n Number of ways of factoring `n` with all factors 1.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A001055;a\n ... |
class A006530(SloaneSequence):
def __init__(self):
'\n Largest prime dividing `n` (with `a(1)=1`).\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A006530;a\n ... |
class A000961(SloaneSequence):
def __init__(self):
'\n Prime powers\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A000961;a\n Prime powers.\n sag... |
class A005117(SloaneSequence):
def __init__(self):
'\n Square-free numbers\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A005117;a\n Square-free numbers.\n ... |
class A020639(SloaneSequence):
def __init__(self):
'\n Least prime dividing `n` with `a(1)=1`.\n\n INPUT:\n\n - ``n`` -- non negative integer\n\n OUTPUT:\n\n - ``integer`` -- function value\n\n EXAMPLES::\n\n sage: a = sloane.A020639;a\n Lea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.