It seems too simple to be a problem for me, but:
sage: attach "/home/bgman/Documents/Python/prob2_1_29.sage"
File "<ipython-input-9-9a83b54672c9>", line 1
attach "/home/bgman/Documents/Python/prob2_1_29.sage"
and
sage: load "/home/bgman/Documents/Python/prob2_1_29.sage"
File "<ipython-input-8-1ab93d7e50c7>", line 1
load "/home/bgman/Documents/Python/prob2_1_29.sage"
both of these result in a SyntaxError: invalid syntax message.
Any ideas what I'm doing wrong?
I don't have any reason to believe it's relevant, but I'm looking at
problem 2.1.29 of Kumanduri's Number Theory with Computer Applications,
investigating which bases and exponents result in 2^p - 1 being prime. I
don't have much experience with sage (or any other computer tool used to
think about such problems). The little program I wrote is:
for i in list(primes(1,25)):
b = 2^i - 1
print "2^",i," - 1 = ", b,
if is_prime(b):
print "is prime"
else:
print "is composite"
Implementing my own is_prime function would be easy and I could then run it
as a python program, but I thought it would be fun to learn a little about
sage and how to use it.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.