3
$\begingroup$

I am working with the finite fields package in Mathematica 9. If I input:

GF[7, {-2, 0, 0, 1}][{3, 4, 1}]^2

Mathematica gives me $\{4,5,1\}_7$. I want to convert this "field element" to the integer $88$, according to $4\times7^0+5\times7^1+1\times7^2$.

$\endgroup$
3
  • 2
    $\begingroup$ Have you looked at FromDigits[]? $\endgroup$ Feb 21, 2016 at 17:19
  • 1
    $\begingroup$ I've formatted your question. But I suggest you add a little more info. $\endgroup$
    – QuantumDot
    Feb 21, 2016 at 17:20
  • 2
    $\begingroup$ See @J.M. 's answer here. $\endgroup$
    – Michael E2
    Feb 21, 2016 at 17:54

1 Answer 1

4
$\begingroup$

As recommended by J. M. use FromDigits

Needs["FiniteFields`"]

gf = GF[7, {-2, 0, 0, 1}][{3, 4, 1}]^2

enter image description here

FromDigits[Reverse[gf[[1]]], 7]

(*  88  *)
$\endgroup$
1
  • 1
    $\begingroup$ Just for fun FromDigits[Reverse@#[[1]], #[[0, 1]]] &@gf $\endgroup$
    – user1066
    Feb 21, 2016 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.