Skip to main content
1 of 2
dianne
  • 1.1k
  • 7
  • 7

Haskell, 57 bytes

f n=[k|k<-[1..n],and[mod(m^k)n<2|m<-[1..n],gcd m n<2]]!!0
dianne
  • 1.1k
  • 7
  • 7