Skip to content

Instantly share code, notes, and snippets.

@brun0xff
Created January 8, 2017 20:28
Show Gist options
  • Save brun0xff/55cb9997d6bb628e5774f196efa18aa5 to your computer and use it in GitHub Desktop.
Save brun0xff/55cb9997d6bb628e5774f196efa18aa5 to your computer and use it in GitHub Desktop.
Star (URI1233): [ Intermediario / Matematica ] É possivel ver que se um numero K tem algum fator comum com N, entao ele ira voltar para a posicao inicial em alguma rodada. Alem disso, para cada coprimo X de N, as estrelas formadas por X e N - X sao iguais. Dessa forma, o resultado final é phi(N) / 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment