SyntaxError
Hello everyone, I'using Sage for three weeks now and I got a problem.I have been looking for the error in this code for about 3 days and I can't figure it out. Maybe you can help me :)
var("a,b,n")
f(n)=n^2+a*n+b:
for a in range(1,41):
for b in range(1,41):
if f(n) in ZZ
for n in range(0,41)
if is_prime(f(n)):
print(a); print(b)
I'm getting the error:
__tmp__=var("n"); f = symbolic_expression(n**Integer(2)+a*n+b:).function(n)
^
SyntaxError: invalid syntax
I hope you can help me :)
There is no need at all for final ";" in sage. And branching commands (if, for,and so on) require a final colon ":", not a final ";"
Weclome to Ask Sage. Thank you for your question.
It seems the indentation was lost, please edit your question to fix that.
Also please remove semicolons at the end of lines, they are not needed.