English subtitles

← 03ps-04 Primitive Roots Solution

dummy description

Get Embed Code
1 Language

Showing Revision 1 created 10/24/2012 by Amara Bot.

  1. Here is my solution. It's a fairly straightforward brute force search.
  2. First, I wrote a function that return if a number r is a primitive root.
  3. A loop through all the possible exponents to see if the result has been seen before in our set s.
  4. If it has, we return False. If no repeats were found, we return True.
  5. Using isprimitiveroot, we then loop through all the possible options,
  6. checking if it's a primitive root and appending it to our list.
  7. When we've looped through all the possible options, we return our list.