Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 20
def F(n): return sum((n-i+1)*euler_phi(i) for i in range(1,n+1)) for n in range(7): F(n)
0 1 3 7 13 23 35
def words(n): return Tuples([0,1],n).list() def mots_equ(n): X=[] for w in words(n): Fact=[] for l in range(1,n+1): for pos_init in range(n-l+1): Fact.append(w[pos_init:pos_init+l]) Fact_loin=[] for u in Fact: for v in Fact: if len(u)==len(v) and sum(u)-sum(v) not in [-1,0,1]: Fact_loin.append((u,v)) Fact_loin if len(Fact_loin)==0: X.append(w) return X def E(n): return len(mots_equ(n))
mots_equ(0) E(0)
[[]] 1
mots_equ(1) E(1)
[[0], [1]] 2
mots_equ(2) E(2)
[[0, 0], [1, 0], [0, 1], [1, 1]] 4
mots_equ(3) E(3)
[[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1], [1, 1, 1]] 8
mots_equ(4) E(4)
[[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [1, 0, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 0, 0, 1], [1, 0, 0, 1], [0, 1, 0, 1], [1, 1, 0, 1], [1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]] 14
mots_equ(5) E(5)
[[0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [1, 0, 1, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 1, 0], [0, 1, 0, 1, 0], [1, 1, 0, 1, 0], [1, 0, 1, 1, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 0], [0, 0, 0, 0, 1], [1, 0, 0, 0, 1], [0, 1, 0, 0, 1], [0, 0, 1, 0, 1], [1, 0, 1, 0, 1], [0, 1, 1, 0, 1], [1, 1, 1, 0, 1], [0, 1, 0, 1, 1], [1, 1, 0, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 1], [1, 1, 1, 1, 1]] 24
mots_equ(6) E(6)
[[0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0], [0, 1, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0], [0, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 1, 0], [0, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 0], [1, 0, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 1], [0, 0, 1, 0, 0, 1], [1, 0, 1, 0, 0, 1], [1, 0, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1], [1, 1, 0, 1, 0, 1], [1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 0, 1], [1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1], [0, 1, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1], [1, 1, 0, 1, 1, 1], [1, 0, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]] 36
limit?
File: /projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/calculus/calculus.py Signature : limit(ex, dir=None, taylor=False, algorithm='maxima', **kwds) Docstring : Return the limit as the variable v approaches a from the given direction. expr.limit(x = a) expr.limit(x = a, dir='+') INPUT: * "dir" - (default: None); dir may have the value 'plus' (or '+' or 'right') for a limit from above, 'minus' (or '-' or 'left') for a limit from below, or may be omitted (implying a two-sided limit is to be computed). * "taylor" - (default: False); if True, use Taylor series, which allows more limits to be computed (but may also crash in some obscure cases due to bugs in Maxima). * "**argv" - 1 named parameter Note: The output may also use 'und' (undefined), 'ind' (indefinite but bounded), and 'infinity' (complex infinity). EXAMPLES: sage: x = var('x') sage: f = (1+1/x)^x sage: f.limit(x = oo) e sage: f.limit(x = 5) 7776/3125 sage: f.limit(x = 1.2) 2.06961575467... sage: f.limit(x = I, taylor=True) (-I + 1)^I sage: f(x=1.2) 2.0696157546720... sage: f(x=I) (-I + 1)^I sage: CDF(f(x=I)) 2.0628722350809046 + 0.7450070621797239*I sage: CDF(f.limit(x = I)) 2.0628722350809046 + 0.7450070621797239*I Notice that Maxima may ask for more information: sage: var('a') a sage: limit(x^a,x=0) Traceback (most recent call last): ... ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details) Is a positive, negative or zero? With this example, Maxima is looking for a LOT of information: sage: assume(a>0) sage: limit(x^a,x=0) Traceback (most recent call last): ... ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details) Is a an integer? sage: assume(a,'integer') sage: limit(x^a,x=0) Traceback (most recent call last): ... ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details) Is a an even number? sage: assume(a,'even') sage: limit(x^a,x=0) 0 sage: forget() More examples: sage: limit(x*log(x), x = 0, dir='+') 0 sage: lim((x+1)^(1/x), x = 0) e sage: lim(e^x/x, x = oo) +Infinity sage: lim(e^x/x, x = -oo) 0 sage: lim(-e^x/x, x = oo) -Infinity sage: lim((cos(x))/(x^2), x = 0) +Infinity sage: lim(sqrt(x^2+1) - x, x = oo) 0 sage: lim(x^2/(sec(x)-1), x=0) 2 sage: lim(cos(x)/(cos(x)-1), x=0) -Infinity sage: lim(x*sin(1/x), x=0) 0 sage: limit(e^(-1/x), x=0, dir='right') 0 sage: limit(e^(-1/x), x=0, dir='left') +Infinity sage: f = log(log(x))/log(x) sage: forget(); assume(x<-2); lim(f, x=0, taylor=True) 0 sage: forget() Here ind means "indefinite but bounded": sage: lim(sin(1/x), x = 0) ind
a=-5 b=4 n=var('n') f=(a^n+b^n)^(1/n) f.limit(n=Infinity)
limit((4^n + (-5)^n)^(1/n), n, +Infinity)
((-3)^11)^(1/11)
3*(-1)^(1/11)
4^3>3^4
False
1/(2*3)>(1/(2*4)+(6/(2^2*4^4)))
True
3*((1/(2*3^2)) )>4*((1/(2*4^2)) +(1/(2*4^2))^3)+(6/(2*4^2))^2
True
binomial(5,4)
5
6*(1/(2*4^2))^2 > 10*((1/(2*5^2))^2+(1/(2*5^2))^3)
True
︠9fa15a84-2cbc-4e78-9ced-290bccdb24b6︠