 CoCalc Public FilesSaad Main / Saad Khalid 2 / tests for 2var finite gammas.sagews
Views : 30
Compute Environment: Ubuntu 18.04 (Deprecated)
var('k');
CC(sum(1/((1- e^(k*2*pi*i/3) )*(1- e^(k*2*pi*i/5) ) ) for k in [1..14] if k%3 != 0 and k%5 != 0))
CC(sum(1/((1- e^(k*2*pi*i/7) )*(1- e^(k*2*pi*i/5) ) ) for k in [1..34] if k%7 != 0 and k%5 != 0))
CC(sum(1/((1- e^(k*2*pi*i/9) )*(1- e^(k*2*pi*i/7) ) ) for k in [1..62] if k%7 != 0 and k%9 != 0))
CC(sum(1/((1- e^(k*2*pi*i/3) )*(1- e^(k*2*pi*i/7) ) ) for k in [1..20] if k%7 != 0 and k%3 != 0))
CC(sum(1/((1- e^(k*2*pi*i/5) )*(1- e^(k*2*pi*i/9) ) ) for k in [1..44] if k%5 != 0 and k%9 != 0))
CC(sum(1/((1- e^(k*2*pi*i/3) )*(1- e^(k*2*pi*i/9) ) ) for k in [1..26] if k%3 != 0 and k%9 != 0))
CC(sum(1/((1- e^(k*2*pi*i/3) )*(1- e^(k*2*pi*i/15) ) ) for k in [1..14] if k%3 != 0 and k%15 != 0))
CC(sum(1/((1- e^(k*2*pi*i/5) )*(1- e^(k*2*pi*i/15) ) ) for k in [1..14] if k%15 != 0 and k%5 != 0))
CC(sum(1/((1- e^(k*2*pi*i/6) )*(1- e^(k*2*pi*i/18) ) ) for k in [1..17] if k%18 != 0 and k%6 != 0))
CC(sum(1/((1- e^(k*2*pi*i/12) )*(1- e^(k*2*pi*i/18) ) ) for k in [1..17] if k%18 != 0 and k%12 != 0))

k 2.00000000000000 - 5.55111512312578e-17*I 6.00000000000000 + 4.99600361081320e-15*I 12.0000000000000 + 3.37507799486048e-14*I 3.00000000000000 + 1.55431223447522e-15*I 8.00000000000000 + 7.77156117237610e-15*I 3.00000000000000 + 3.44169137633799e-15*I 1.66666666666667 + 2.22044604925031e-16*I -1.11022302462516e-15 + 5.55111512312578e-16*I -1.24999999999999 + 3.83026943495679e-15*I -1.00000000000000 + 1.97168783648704*I
[1..14]

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
total = 0
sum(1 for k in [1..14] if k%3 != 0 and k%5 != 0)
sum(1 for k in [1..34] if k%7 != 0 and k%5 != 0)
sum(1 for k in [1..62] if k%7 != 0 and k%9 != 0)
sum(1 for k in [1..20] if k%7 != 0 and k%3 != 0)
sum(1 for k in [1..44] if k%5 != 0 and k%9 != 0)
sum(1 for k in [1..26] if k%3 != 0 and k%9 != 0)
sum(1 for k in [1..14] if k%3 != 0 and k%15 != 0)
sum(1 for k in [1..14] if k%5 != 0 and k%15 != 0)
sum(1 for k in [1..17] if k%6 != 0 and k%18 != 0)
sum(1 for k in [1..17] if k%12 != 0 and k%18 != 0)

8 24 48 12 32 18 10 12 15 16
var('x')
taylor((x^2 + x)/(1-x)^3,x,0,3)

x 9*x^3 + 4*x^2 + x
taylor?

/ext/sage/sage-8.0/local/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py:46: DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead import OpenSSL.SSL
File: /ext/sage/sage-8.0/local/lib/python2.7/site-packages/sage/calculus/functional.py
Signature : taylor(f, *args)
Docstring :
Expands self in a truncated Taylor or Laurent series in the
variable v around the point a, containing terms through (x - a)^n.
Functions in more variables are also supported.

INPUT:

* "*args" - the following notation is supported

* "x, a, n" - variable, point, degree

* "(x, a), (y, b), ..., n" - variables with points, degree of
polynomial

EXAMPLES:

sage: var('x,k,n')
(x, k, n)
sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6)
-1/720*(45*k^6 - 60*k^4 + 16*k^2)*x^6 - 1/24*(3*k^4 - 4*k^2)*x^4 - 1/2*k^2*x^2 + 1

sage: taylor ((x + 1)^n, x, 0, 4)
1/24*(n^4 - 6*n^3 + 11*n^2 - 6*n)*x^4 + 1/6*(n^3 - 3*n^2 + 2*n)*x^3 + 1/2*(n^2 - n)*x^2 + n*x + 1

sage: taylor ((x + 1)^n, x, 0, 4)
1/24*(n^4 - 6*n^3 + 11*n^2 - 6*n)*x^4 + 1/6*(n^3 - 3*n^2 + 2*n)*x^3 + 1/2*(n^2 - n)*x^2 + n*x + 1

Taylor polynomial in two variables:

sage: x,y=var('x y'); taylor(x*y^3,(x,1),(y,-1),4)
(x - 1)*(y + 1)^3 - 3*(x - 1)*(y + 1)^2 + (y + 1)^3 + 3*(x - 1)*(y + 1) - 3*(y + 1)^2 - x + 3*y + 3