2020-12-16 18:00:27 +0200 received badge ● Notable Question (source) 2020-11-07 20:56:54 +0200 received badge ● Notable Question (source) 2020-01-17 18:35:47 +0200 received badge ● Popular Question (source) 2018-11-27 03:16:34 +0200 commented answer Finding coprime integers near a lattice point This works! Thanks! 2018-11-27 03:15:55 +0200 commented question Finding coprime integers near a lattice point I am not quite sure what you mean, since $\gcd(1275,1309)=17$. 2018-11-26 07:49:39 +0200 asked a question Finding coprime integers near a lattice point I have a list $L$ of ordered pairs $(n,m)$ where $n$ and $m$ are integers. I would like to know which elements $(n,m)$ in $L$ satisfy the property that $\gcd(n+i,m+j) \neq 1$ for $i =-1,0,1$ and $j =-1,0,1.$ For example the point $(55,21)$ has this property since $[(55+i,21+j) ] = [(54,20),(54,21),(54,22),(55,20),(55,21),(55,22),(56,20),(56,21),(56,22)].$ I have tried the following : for (n,m) in L: for i in range(-1,2): for j in range(-1,2): if gcd(n+i,m+j)!=1: print(n,m) which returns any point with $gcd =1$ which is not what I want. Thanks very much for your help! 2018-11-26 03:28:36 +0200 received badge ● Popular Question (source) 2015-06-09 20:45:03 +0200 commented question Assigning variables in a list That is probably true since I am very new to Python and to programming in general. The code I used is a bit lengthy so I will try to explain in words what I need. I basically want Sage to assume V[i]=V[7-i] for i in range(j) when solving the system. I tried to use the assume command but wasnt successful. 2015-06-09 20:39:57 +0200 commented answer Assigning variables in a list Thanks, but this is not what I was looking for. I would like sage to assume x=d, y=c and so on when solving the system. 2015-06-08 21:52:51 +0200 asked a question Assigning variables in a list I have a variables list which I use to construct a system of linear equations then I use sage to solve this system. Before I use the solve command I like to equate some of the variables in the list. For example if V is the following list var('x,y,z,w,a,b,c,d') V2=[x,y,z,w,a,b,c,d] I would like to assignV[i]=V[7-i] for i in [0..3]. When I do this I get invalid syntax error. I know that I could easily set x=d, y=c and so on but this is not feasible when the list has too many items in it. Thank you for your help! 2015-05-22 18:26:00 +0200 commented answer Doubly indexed sum Thanks very much for your help! it works. 2015-05-22 18:25:59 +0200 received badge ● Scholar (source) 2015-05-22 17:53:04 +0200 asked a question Doubly indexed sum I would like to define a doubly indexed sum. Below is what I did: V=list(var(','.join(['a_%d%d' % (i,n) for i in [0..5] for n in [0..5]]))) sum(a_in*binomial(5,i)*binomial(5,n) for i in [0..5] for n in [0..5])  I get the global name 'a_' is not defined error. I tried this when there is only one index and it works, but doesnt seem to work for double index. Can anyone help me with this?