Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Alternate solution : run

# https://ask.sagemath.org/question/80866/solve-for-integer-and-real-number/
L = [vector(v, immutable=True) for v in [[1,0,0], [0,1,0], [0,0,1]]]
var('i', domain = 'integer')
C=vector([6, 0, 0])
Sols ={l:solve(list(map(lambda v, c:i*v==c, l, C)), i) for l in L}
Sol = {l:flatten(Sols[l]) for l in Sols.keys() if len(flatten(Sols[l]))>0}

Then,

sage: Sol
{(1, 0, 0): [i == 6]}

HTH,