Skip to main content
added 9 characters in body
Source Link
dianne
  • 1.1k
  • 7
  • 7

Haskell, 5757 56 bytes

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

Haskell, 57 bytes

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

Haskell, 57 56 bytes

f n=[k|k<-[1..],and[mod(m^k)n<2|m<-[1..n],gcd m n<2]]!!0
Source Link
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