> > We were lucky, for Sage contains a twinprimes object. > > sage: twinprime > twinprime > sage: twinprime(4) > /home/ncohen/.Sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py:2883: > > DeprecationWarning: Substitution using function-call syntax and unnamed > arguments is deprecated and will be removed from a future release of Sage; > you can use named arguments instead, like EXPR(x=..., y=...) > See http://trac.sagemath.org/5930 for details. > ... > ValueError: the number of arguments must be less than or equal to 0 > sage: twinprime() > twinprime > sage: twinprime()()()()()()()()()()()()() > twinprime > sage: twinprime()==twinprime > twinprime == twinprime > > As you can see, it is not immediately obvious what this object is. And > Sage's doc for "twinprime?" is not exactly... Explicit. > > Explanation: it turns out that for Sage, "twinprimes" is a constant, like > pi, e, gamma, ... >
Indeed. I'm not sure how to fix this, though. http://git.sagemath.org/sage.git/tree/src/sage/symbolic/constants.py#n1149 In this class, we don't quite instantiate the nice documentation we actually have for TwinPrime r""" The Twin Primes constant is defined as `\prod 1 - 1/(p-1)^2` for primes `p > 2`. EXAMPLES:: sage: float(twinprime) 0.6601618158468696 sage: twinprime.n(digits=60) 0.660161815846869573927812110014555778432623360284733413319448 """ but instead do TwinPrime().expression() which gets rid of all that useful info. Same for most such constants, I believe, so that they are in the symbolic ring/Ginac. Does anyone have a quick way to fix this? (Maybe even by getting rid of .expression() ?) I have wondered about this too but I knew what the twin prime constant was so I didn't run into it... but of course Nathann is right that this is not that helpful currently. - kcrisman -- 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 post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.