Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hurwitz_zeta(0, x) not expanding #32016

Closed
PeterLuschny opened this issue Jun 21, 2021 · 13 comments
Closed

Fix hurwitz_zeta(0, x) not expanding #32016

PeterLuschny opened this issue Jun 21, 2021 · 13 comments

Comments

@PeterLuschny
Copy link

Having defined:

def B(n, x):
    return -n*hurwitz_zeta(1 - n, x) if n != 0 else 1

we expect expand(B(n, x)) to
match bernoulli_polynomial(x, n).

Using this small utility function to compare them:

def table(nmax):
    nab = [('n', 'expand(B(n, x))', 'bernoulli_polynomial(x, n)')]
    nab.extend([(n, expand(B(n, x)), bernoulli_polynomial(x, n))
                for n in range(nmax + 1)])
    k = len(str(nmax))
    m = max(len(str(x)) for t in nab for x in t)
    hline = '-' * (k + m + 7)
    print(hline)
    for n, a, b in nab:
        print(f' %{k}s     %{m}s' % (n, a))
        print(f' %{k}s     %{m}s' % ('', b))
        print(hline)

we notice they match except for n = 1:

sage: table(4)
----------------------------------
 n                expand(B(n, x))
       bernoulli_polynomial(x, n)
----------------------------------
 0                              1
                                1
----------------------------------
 1            -hurwitz_zeta(0, x)
                          x - 1/2
----------------------------------
 2                  x^2 - x + 1/6
                    x^2 - x + 1/6
----------------------------------
 3          x^3 - 3/2*x^2 + 1/2*x
            x^3 - 3/2*x^2 + 1/2*x
----------------------------------
 4       x^4 - 2*x^3 + x^2 - 1/30
         x^4 - 2*x^3 + x^2 - 1/30
----------------------------------

This ticket fixes that case.

CC: @slel

Component: symbolics

Keywords: hurwitz_zeta

Author: Frédéric Chapoton

Branch/Commit: 785b4e2

Reviewer: Peter Luschny

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

@fchapoton
Copy link
Contributor

comment:1

fixed, please review


New commits:

785b4e2Hurwitz zeta at n=0

@fchapoton
Copy link
Contributor

Branch: u/chapoton/32016

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

Commit: 785b4e2

@PeterLuschny
Copy link
Author

comment:2

Looks good to me. Merci!

@fchapoton
Copy link
Contributor

comment:3

reviewer full name please

@PeterLuschny
Copy link
Author

Reviewer: Peter Luschny

@PeterLuschny
Copy link
Author

comment:4

I don't know if I am qualified as a reviewer in the sense of the SageMath organization.

@slel
Copy link
Member

slel commented Jun 27, 2021

comment:5

I don't know if I am qualified as a reviewer
in the sense of the SageMath organization.

You are!

@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Jun 27, 2021

Changed keywords from none to hurwitz_zeta

@slel slel changed the title hurwitz_zeta(0, x) does not expand Fix hurwitz_zeta(0, x) not expanding Jun 27, 2021
@slel

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented Jul 25, 2021

Changed branch from u/chapoton/32016 to 785b4e2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants