Skip to main content
added 349 characters in body
Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

36 bytes

f n=and[mod(gcd d n^n)n<2|d<-[1..n]] 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

40 bytes

f n=and[mod(p^n)n<1|p<-[2..n],mod n p<1] 

Try it online!

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

40 bytes

f n=and[mod(p^n)n<1|p<-[2..n],mod n p<1] 

Try it online!

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

36 bytes

f n=and[mod(gcd d n^n)n<2|d<-[1..n]] 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

40 bytes

f n=and[mod(p^n)n<1|p<-[2..n],mod n p<1] 

Try it online!

added 352 characters in body
Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

40 bytes

f n=and[mod(p^n)n<1|p<-[2..n],mod n p<1] 

Try it online!

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!

40 bytes

f n=and[mod(p^n)n<1|p<-[2..n],mod n p<1] 

Try it online!

Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Haskell, 36 bytes

f n=mod(until((<1).mod n)(+1)2^n)n<1 

Try it online!

39 bytes

f n=all((`elem`[1,n]).gcd n.(^n))[2..n] 

Try it online!

39 bytes

f n=mod n(n-sum[1|1<-gcd n<$>[1..n]])<1 

Try it online!