| 1 | initial version |
Your best route would be to learn some Python before dealing with Sage. Think Python is a nice introductory book: https://greenteapress.com/wp/think-python-2e/
As for you specific questions, this seems to answer your first question:
divisors(36)[4]^2
and the second one can be answered with two loops and is_prime() function - like:
for y in range(6):
for z in range(x,x+101):
if is_prime(3^z + 2*y):
# do what you want
| 2 | No.2 Revision |
Your best route would be to learn some Python before dealing with Sage. Think Python is a nice introductory book: https://greenteapress.com/wp/think-python-2e/
As for you specific questions, this seems to answer your first question:
divisors(36)[4]^2
and the second one can be answered with two loops and is_prime() function - like:
def mytest(x):
for y in range(6):
for z in range(x,x+101):
if is_prime(3^z + 2*y):
# do what you want
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.