Skip to content

Lazy Dirichlet Series #32309

@mantepse

Description

@mantepse

We implement lazy Dirichlet series. For example,

sage: L = LazyDirichletSeriesRing(ZZ, "z")
sage: g = L(constant=1); g
1 + 1/(2^z) + 1/(3^z) + ...
sage: g*g
1 + 2/2^z + 2/3^z + 3/4^z + 2/5^z + 4/6^z + 2/7^z + ...
sage: [number_of_divisors(n) for n in range(1, 8)]
[1, 2, 2, 3, 2, 4, 2]

sage: mu = L(moebius); mu
1 + -1/2^z + -1/3^z + -1/5^z + 1/(6^z) + -1/7^z + ...
sage: g*mu
1 + ...

sage: g = L([0], constant=1)
sage: F = L(None)
sage: F.define(1 + g*F)
sage: ff = [F[i] for i in range(1, 16)]; ff
[1, 1, 1, 2, 1, 3, 1, 4, 2, 3, 1, 8, 1, 3, 3]
sage: oeis(ff)                              # optional, internet
0: A002033: Number of perfect partitions of n.
1: A074206: Kalmár's [Kalmar's] problem: number of ordered factorizations of n.
...

CC: @tscrim @tejasvicsr1 @slel @kcrisman

Component: combinatorics

Keywords: LazyPowerSeries, FormalSeries

Author: Martin Rubey, Travis Scrimshaw

Branch/Commit: 5b48191

Reviewer: Travis Scrimshaw, Martin Rubey

Issue created by migration from https://trac.sagemath.org/ticket/32309

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions