tl;dr, 80 lines, sorry. I think there is a better alternative than changing the current implementation of the Bernoulli numbers.
Fredrik: "The sign convention for B_1 is fairly arbitrary, ..." Calling the question a 'convention' sets a wrong framing from the start. Conventions are treated differently than bugs. And this is a bug. Setting B- leads to inconsistency in several identities, which I have described on my known web-page. Fredrik, honestly, do you really think Knuth rewrites TAOCP and CM just to change an arbitrary sign convention? Knuth expressly considers it a mistake. As long as the discussion is viewed as one about conventions, it is uninteresting and does not improve our understanding of the situation. People who believe this can equally well flip a coin when in doubt. Best leave the whole discussion behind, the question of + or -, the question of convention or bug, the question of decision or compromise, or what people on Twitter think (Fredrik asked :)) All answers to such questions must be profoundly unsatisfactory. The matter should be solved mathematically in a way Euler would have liked, without resorting to this absurd fixation on a single value. And by that, I mean to define a suitable complex function, call it the 'Bernoulli function', and then say: The 'Bernoulli numbers' are the values of this function on the non-negative integers. Everyone knows a possible way to do this: B(z) = -z*zeta(1-z). Of course, you could add a sin or cos factor to it (Fredrik mentioned that, Knuth too, by the way), but why should you do that? Occam's razor speaks against it. Maximum simplicity has always belonged to the beauty criteria in mathematics. Similar approaches have already been done; Helmut Hasse, for example, has constructed the corresponding function without recourse to the zeta function. And there are also other representations without reference to the zeta function. Another pleasing possibility is via the Jensen-Johansson-Blagouchine formulas, first given by Jensen and first proved by Johansson and Blagouchine ("Computing Stieltjes constants using complex integration"). These formulas are also the starting point in my arXiv paper. There I try to show that this function is also essential in other contexts in the theory of special numbers and offers some technical advantages. * My suggestion: Offer this function in Sage. This may not mean much more than a three-line wrapper around the zeta function. Then the current code does not have to be changed, no deprecation warnings, no keywords for alternatives are required. The decision is then solely up to the user whether he wants to continue the current usage and use bernoulli(n) or find pleasure in bernoulli_function(n). Fredrik's fear that new "ambiguity and inconsistency" could creep in is then unfounded: The names and the definitions are too different; here polynomials, there a zeta-like function, both with different applications. If you want to describe this approach in a highfalutin way, it is Grothendieck-ish. It does not answer the question which of the two values is the 'correct' one; it shows how this problem disappears when put into the proper conceptual framework. This approach also makes sense in all the other cases that Fredrik has to decide. With it, the burden of making a sensible decision is turned into the freedom for the user to explore a fascinating function. -- Peter -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/19d2d0c8-556b-4bbf-a9d1-e87e7e8ed4c9n%40googlegroups.com.