ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 03 May 2020 05:46:41 -0500SyntaxErrorhttps://ask.sagemath.org/question/51244/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 :)Sam_NaSun, 03 May 2020 05:46:41 -0500https://ask.sagemath.org/question/51244/conditions among the variableshttps://ask.sagemath.org/question/48809/conditions-among-the-variables/ Suppose I am defining some variables in sagemath. How can I give conditions among the variables such that the condition is applied in the future calculations?
Thank You.user789Tue, 19 Nov 2019 06:55:04 -0600https://ask.sagemath.org/question/48809/Plotting systems of linear equations with 3 variableshttps://ask.sagemath.org/question/43586/plotting-systems-of-linear-equations-with-3-variables/ Hello,
Is there a way to plot these 3 equations in 3d space that would show them intersecting?
2x + 3y - z = 15,
x - 3y + 3z = -4,
4x - 3y - z = 19,
I can get the numerical answers, but I'd love to be able to show a graphical representation to students and myself.
Thank you,
Steve.
Here is the code for the numerical answers:
# 2*x + 3*y - z == 1
# x - 3y + 3z == - 4
# 4*x -3*y- z == 19
var('x,y,z')
words = solve([2*x + 3*y - z == 15, x - 3*y + 3*z == - 4,4*x -3*y- z == 19],x,y,z)
words
SteveFWed, 05 Sep 2018 02:08:16 -0500https://ask.sagemath.org/question/43586/