Hello guys, sorry in advance for the bad english I'm actually a french. So I did a program for the theorem of bezout in spemath. It normally show the couple of number u and v.
this is the code:
Define eucl()=
Prgm
:Request "a=",a₀
:Request "b=",b₀
:Request "c=",c
:1→p
:0→k
:0→g
:1→s
:While b≠0
:mod(a,b)→r
:intDiv(a,b)→q
:If r≠0 Then
: Disp a,"=",q,"*",b,"+",r
: b→a
: r→b
: p-q*g→nr
: k-q*s→ns
:EndIf
:If r≠0 Then
: Disp r,"=",nr,"*",a₀,"+",ns,"*",b₀
:EndIf
:g→p
:s→k
:nr→g
:ns→s
:EndWhile
:((p*c)/(gcd(a₀,b₀)))→l
:((k*c)/(gcd(a₀,b₀)))→m
:Disp "Solution particulière(",p,";",k,")"
:Disp "Solution de l'équation",a₀,"u+",b₀,"v=",c,":",l,";",m,")"
:EndPrgm