Discussion:
[GAP Forum] Inverse operation of ListOfDigits.
[Muniru Asiru] maasiru@yahoo.com
2018-03-29 11:58:20 UTC
Permalink
Dear Forum, Dear all,

If I am given that
a:=123456;;  b:=ListOfDigits(a);
Is it possible in GAP for me to recover a given b?

Thanks.

Dr. Muniru A. Asiru, Department of Mathematics & Statistics, The Federal Polytechnic, P.M.B. 55, Bida, Niger State, Nigeria. OR Dr. Muniru A. Asiru, P.O.Box. 294, Bida, Niger State, Nigeria. Email Addresses: ***@yahoo.com, ***@yahoo.com, Mobile Phone number: +2348034271010
Philippe Cara (Latitude)
2018-03-29 13:17:51 UTC
Permalink
Dear Muniru,

Yes, it's easy:

gap> Sum([0..Length(b)-1], k -> b[Length(b)-k]*10^k);
123456

Best regards, --Philippe
Post by [Muniru Asiru] ***@yahoo.com
Dear Forum, Dear all,
If I am given that
a:=123456;;  b:=ListOfDigits(a);
Is it possible in GAP for me to recover a given b?
Thanks.
Dr. Muniru A. Asiru, Department of Mathematics & Statistics, The
Federal Polytechnic, P.M.B. 55, Bida, Niger State, Nigeria. OR Dr.
Muniru A. Asiru, P.O.Box. 294, Bida, Niger State, Nigeria. Email
number: +2348034271010
_______________________________________________ Forum mailing list
https://mail.gap-system.org/mailman/listinfo/forum
Loading...