Question: solve for the assumed integer

restart;
a=1-(1+x)*exp(-x);
SS:=solve(%,x,allsolutions);
evalf(eval(SS,[_Z2=0,a=0.3]));evalf(eval(SS,[_Z2=-1,a=0.3]));

I know there are two branches for the lambertw function meet my demand.

I wonder whether there is a method to find the _Z2 value with SS::real, for the above commands, they are 0&-1.

thank you for any advice.

Please Wait...