I wrote a program which finds all finite fields with n elements. For n=2,3,4 this program works very well. It finds only one finite field for n=2,3 and 4. But for n=5 it finds no field. Does my program have a bug? The function “allFields[n]” in this program should find all fields with n elements.
The easy answer is yes, there must be a bug in your code. But your code comes with no explanation of what it does. There is no indication of how you are representing the fields. Really not much to go on, and it is a considerable task for one to sort through all that code.