I am trying to do an if block in sage. For example, I have code: for n in range(7): if gcd(n,3)==3: n=n/3; n=n+1; print(n)
This "should" only add one when n is divisible by 3, but seems to do this all the time. Any ideas?
1 | initial version |
I am trying to do an if block in sage. For example, I have code: for n in range(7): if gcd(n,3)==3: n=n/3; n=n+1; print(n)
This "should" only add one when n is divisible by 3, but seems to do this all the time. Any ideas?
2 | No.2 Revision |
I am trying to do an if block in sage. For example, I have code:
code:
for n in range(7):
if gcd(n,3)==3:
n=n/3;
n=n+1;
print(n)print(n)
This "should" only add one when n is divisible by 3, but seems to do this all the time. Any ideas?