On Mon, Jun 17, 2019 at 5:18 AM Peter Luschny <peter.lusc...@gmail.com> wrote:
> Hi, > > I think we should be confident that the sum of integers is > again an integer, the sum of rational numbers a rational number > and that the sum of polynomials is a polynomial. > > With Sage this is not the case. > > def ib(m, n): return sum(binomial(m*n-1, m*k)*OmegaPolynomial(m,k) for k > in (0..n-1)) > > The terms "binomial(m*n-1, m*k)*OmegaPolynomial(m,k)" are of type > <type > 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'> > > However "for n in (0..6): print(ib(2, n).list())" yields an > AttributeError: 'int' object has no attribute 'list'. > > OK, it is not difficult to work around this. > But would you agree to call this behavior a bug? > > I don't know what OmegaPolynomial is. However, if you replace it by cyclotomic_polynomial, it seems to work as expected, doesn't it? sage: *def* *ib*(m, n): *return* sum(binomial(m*n-*1*, m*k)*cyclotomic_polynomial(m*(k+*1*)) *for* k in (*0.*.n-*1*)) sage: ib(*2*,*2*) 3*x^2 + x + 4 sage: type(ib(*2*,*2*)) <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'> sage: ib(*2*,*2*).list() [4, 1, 3] > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-support. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/de96a2b1-562c-4c09-9c38-07685a5bff4c%40googlegroups.com > <https://groups.google.com/d/msgid/sage-support/de96a2b1-562c-4c09-9c38-07685a5bff4c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAEQuuAXLKDTrdLeEciAtehYzXbPyB7hRgxrfUdv7GkgWiAQVeA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.